91 Posted Topics

Member Avatar for Niloofar24

Hi everybody. What is the usage of `urljoin`? An example: >>> from urlparse import urljoin >>> url = urljoin('http://python.org/','about.html') >>> url 'http://python.org/about.html' I think the answer is that when we take a link from here `'http://www.python.org/` for example , it looks like this `<a href="/about/>about</a>`. So if i take the …

Member Avatar for Niloofar24
0
833
Member Avatar for Niloofar24

Hello. I'm trying to create a web crawler. I've read about web crawler's duty and about how it works and what he does. But just need more information. Could you please tell me what does a web crawler can do? What kind of duty i can define for my web …

Member Avatar for Niloofar24
0
328
Member Avatar for Niloofar24

Hello, me again :) With this code: >>> from BeautifulSoup import BeautifulSoup >>> import urllib2 >>> url = urllib2.urlopen('http://www.python.org').read() >>> soup = BeautifulSoup(url) >>> links = soup('a') >>> print links A list of links printed into the terminal. I want to send the list into a text file, i tried …

Member Avatar for Niloofar24
0
738
Member Avatar for Niloofar24

Hi again. I want to create a robot or spider or crawler with python urllib. Still couldn't find any good tutorial. Any suggestion?!

Member Avatar for vegaseat
0
421
Member Avatar for Niloofar24

Hi friends. With `datetime.datetime.now()` or `datetime.datetime.today()` i can get the current date (English calendar) for my program but what about if i want to get the current date (from Persian calendar) for my program; then what should i do? As my pc os date is set to English calendar so …

Member Avatar for Niloofar24
0
341
Member Avatar for Niloofar24

Hello. I want to learn python urllib. I have installed it and now looking for a good tutorial, any suggestion?

Member Avatar for Niloofar24
0
281
Member Avatar for Niloofar24

Hi friends! import urllib url = 'http://www.python.org' text = urllib.urlopen(url).read() I have typed the code above on the terminal and in the next line with `print text` an html file printed there. I want to send it to a text file, how can i do that?

Member Avatar for Niloofar24
0
297
Member Avatar for Niloofar24

I want to exchange line 18 text with line 23 lable text, but here line 18 doesn't work in my code? Any idea?! from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label def timer(): delta = datetime.datetime(2015, 3, 21, 2, 15, 11) - datetime.datetime.now() days = delta.days …

Member Avatar for Niloofar24
0
3K
Member Avatar for Niloofar24

Hello. I have copied these 2 files of code from a website. main.py: from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.clock import Clock from kivy.properties import StringProperty import datetime class Counter_Timer(BoxLayout): def update(self, dt): delta = datetime.datetime(2015, 9, 13, 3, 5) - datetime.datetime.now() self.days …

Member Avatar for vegaseat
0
1K
Member Avatar for Niloofar24

Hello friends. I want to create a countdown program for the new year that is comming. I know i can use this code for example, for short certain time: from threading import Timer def sayhi(): print "hello everybody!" t = Timer(10, sayhi) t.start() But the new year begins in 29 …

Member Avatar for Niloofar24
0
822
Member Avatar for Niloofar24

Hello. I'm new to PHP, i've started it yesterday. I want to creat a simple CMS with (PHP and PDO), what should i do? I'm going to start with creating the CMS core. I want to create sth like a simple wordpress. What should i do? Where should i start …

Member Avatar for Niloofar24
0
1K
Member Avatar for Niloofar24

Hello. I have a list: mylist = [2,4,4] How can i take number 244 out from the list? Something like: number = 244 Here 244 is integer.

Member Avatar for vegaseat
0
299
Member Avatar for MustafaScript

The best start for python is "Python for Kids.pdf". You can download the book from here: http://it-ebooks.info/book/2226/ I started python with that book, it was a great tutorial with so clear explanation. Attention that it's a book for kids! So you can't find any other refrence better than this! Try …

Member Avatar for fonzali
0
417
Member Avatar for Niloofar24

Hello again. How can i limit my list indexes? I want my list to take only 3 indexes for example.

Member Avatar for Niloofar24
0
623
Member Avatar for Niloofar24

Hi, me again :) Look at this error please: File "./kivycal-1", line 103, in number_two self.check() TypeError: check() takes exactly 2 arguments (1 given) The error is pointing to here: def number_two(self, event): global numbers numbers.append(2) print numbers self.check() This is a part of a class in a .py file. …

Member Avatar for Niloofar24
0
310
Member Avatar for Niloofar24

Hello. mylist = [6, '/', 3, '+', 9, '+', 8, '+', 1, '/', 2] How can i delete that list indexes? I tried: def clear(self, event): global numbers for i in numbers: print i del numbers[i] But it didn't work: File "./kivycal", line 83, in clear del numbers[i] TypeError: list …

Member Avatar for Niloofar24
0
276
Member Avatar for Niloofar24

Hello. I have a list like this: mylist = [7, "+", 2, "+", 1] I want to take them out of the list inorder to run the operation and get the real result; something like this: result = 7 + 2 + 1 So the result variable will be set …

Member Avatar for Niloofar24
0
334
Member Avatar for Niloofar24

Hello. I have a Class in my python file. That Class contains some functions. How can i set the command of a Tkinter butten so that call a function of that class? I tried this but it didn't work: class calculating(object): def __inint__(self): self.current = 0 def addition(self, amount): self.current …

Member Avatar for HiHe
0
10K
Member Avatar for Niloofar24

I'm going to learn kivy programming language. Could you introduce some good tutorials to me please? Except the kivy.org. And also i'm looking for a good Kivy forum.

Member Avatar for Ene Uran
0
302
Member Avatar for Niloofar24
Member Avatar for Niloofar24

Hello. I'm using Linux OS, Python 2 and the last version of Kivy framework. Here i have 2 files that i have typed them exactly as what i watched on a kivy tutorial video. Fist file is "main.py": from kivy.app import App from kivy.uix.scatter import Scatter from kivy.uix.label import Label …

Member Avatar for vegaseat
0
4K
Member Avatar for Niloofar24

Hi. How can i open a mp3 file and play it in python? There is a mp3 file on my Linux desktop and i want to open it from a python file and play it. What should i do?

Member Avatar for Niloofar24
0
30K
Member Avatar for Niloofar24

Hi everybody. I have problem with .pack() and .grid(). I have to use this line: mywin.pack(fill=BOTH, expand=YES) I have used .grid every where on my file but now here i have copied a pice of code from some where and have pasted to my file, as you see it has …

Member Avatar for vegaseat
0
4K
Member Avatar for Niloofar24

Hello. When we want to insert a vlue into a table in sqlite, we use this line, right? cursor.execute('INSERT INTO colors Values ("red", "blue")') As we can see above, we want to insert 2 words and we type them as when we are typing whole the codes. But i want …

Member Avatar for vegaseat
0
5K
Member Avatar for Niloofar24

Hello everybody. How can i get "ls" from shell scripting? I tried this but it doesn't work, i saved it in a file: #!/bin/bash $ls I know the second line is not correct, so what should i type? Getting "ls" is just an example, i infact want to import this …

Member Avatar for Niloofar24
0
257
Member Avatar for Niloofar24

Hi everybody. I'm using python to create sql database. I created a test.db file and then made a table on it with the name "fims" and inserted some data on it.... title text, year text and director text. And then set values for them. Now when i type "sqlite3 test.db" …

Member Avatar for HiHe
0
313
Member Avatar for Niloofar24

Hello. I have used ScrolledText in my code, the scroll bar that appears is attached to the frame and although it scrolls the text box contents, I want that it was attached to the text widget itself. What can i do?

Member Avatar for HiHe
0
349
Member Avatar for Niloofar24

Hello friends :) I'm almost familiar with Tkinter and Kivy frameworks, but i'm looking for other python GUI frameworks, soething better than Tkinter. Kivy is also great but i need to watch more tutorial videos and i'm not able to do that right now. Can you introduce a better and …

Member Avatar for vegaseat
0
844
Member Avatar for Niloofar24

Hello everybody. I need a quick help. I have a problem with running my python file code. I use Linux. I had a file with the name "app3.py" file on the Desktop; then i removed ".py" from the end of the name of the file; so now i have "app3" …

Member Avatar for Gribouillis
0
444
Member Avatar for Niloofar24

Hello. How can i set an image as a Tkinter window background? I mean the whole background of the window not a photo area.

Member Avatar for HiHe
0
50K
Member Avatar for Niloofar24

Hi everybody. How can i install ttk module on linux? When i try to import and use it on my Tkinter window, the error says sth like there is no module named ttk. So it means i should install it right?! I'm using python 2. I want to use ttk …

Member Avatar for Gribouillis
0
12K
Member Avatar for Niloofar24

Hello. Imagin we have a python file with many alphabet letters like this: (Which is infact meaningful like i am a programmer) i a m a p r o g r a m m e r How can i print them randomly that nobody could read it? sth like this …

Member Avatar for Lardmeister
0
263
Member Avatar for Niloofar24

Hi friends! I'm coding a program; i have a Tkinter window with a view button and i can add names with entry box and add button into a list that will be saved on a db file. Now i want the program to show the list names otomaticly when the …

Member Avatar for Niloofar24
0
258
Member Avatar for Niloofar24

Hello! My this time question is about breaking a list. I have a list with the name favorite_movies. Here is 2 functions of all functions from the file: def add(): load_favorite() favorite_movies.append(ent.get()) dump_favorite() #print (colors) def view(): load_favorite() from Tkinter import * v = Tk() v.geometry('300x300') v.configure(background = 'white') top …

Member Avatar for Niloofar24
0
572
Member Avatar for Niloofar24

Hi everybody. How can i creat e text file to use as a database in python? I want to save my project's data changes into hard disk. What should i do?

Member Avatar for snippsat
0
5K
Member Avatar for fonzali

Can you explaine a little more clear?! My language is Persian, what do you want to do? I did'nt understand your meaning.

Member Avatar for fonzali
0
748
Member Avatar for Niloofar24

Hello friends :) This is my code: #!/usr/bin/env python3 # -*-coding: utf8-*- def callback(): lbl.configure(text = 'button clicked!') import Tkinter window = Tkinter.Tk() window.geometry('300x300') window.configure(background = 'PeachPuff3') lbl = Tkinter.Label(window, text = 'Nothing yet!') btn = Tkinter.Button(window, text = 'add', command = callback).pack() window.mainloop() Why it doesn't work?

Member Avatar for Niloofar24
0
10K
Member Avatar for Niloofar24

Hi everybody! How can i call a function from Tkinter without using Buttons? I have a test.py file and there is a function def message in it: def message(): print('Good morning') from Tkinter import * tk = Tk() tk.mainloop() I want to type test.py message from linux terminal and the …

Member Avatar for sneekula
0
11K
Member Avatar for Niloofar24

Hello everybody! Me again with an other question :) I have a file with a list and 3 functions in it; view, sort, append. I used pickle to save data changes in to an other file (films.db). Imagine you want to use this programe for the first time on your …

Member Avatar for Niloofar24
0
2K
Member Avatar for Niloofar24

Hello! I have a file with a list and 3 functions in it; view, append and sort functions. I want to use pickle to save data changes in to another file inorder to retrive it next time. I have a list, when i call function VIEW, i see the primary …

Member Avatar for sneekula
0
179
Member Avatar for Niloofar24

Hi everybody. I've created a .py file with a simple function in it. Now i want to call that function from linux shell scripting. How should i do that? please help me, thank you.

Member Avatar for Niloofar24
0
1K

The End.