Re: [Tutor] Delete in .dat

2006-03-04 Thread Danny Yoo
On Sat, 4 Mar 2006, ryan luna wrote: > My question seems like itd be farly simple but i cant seem to get it to > work, My .dat file is a dictionary and i need to be able to only delete > a single word and its definition, heres what i have so far but it > doesn't work. Hi Ryan, By "doesn't work

[Tutor] Delete in .dat

2006-03-04 Thread ryan luna
My question seems like itd be farly simple but i cant seem to get it to work, My .dat file is a dictionary and i need to be able to only delete a single word and its definition, heres what i have so far but it doesn't work. pickle_file = open("dictionary.dat", "r") dictionary = cPickle.loa

Re: [Tutor] Tutorial for creating web server

2006-03-04 Thread w chun
> i wanted to create my own web server, can any body suggest any tutorial, > by the way i have gone through book Core Python Programing, in this book > one example is given but it is to abstract, that i am unable to understand rakesh, 1) based on this thread and responses from various folks,

Re: [Tutor] how to get the return value?

2006-03-04 Thread Anna Ravenscroft
On 3/4/06, Ingo <[EMAIL PROTECTED]> wrote: To make a time lapse video I've been playing with the sched module.There is one problem I run into, in the code below, how do I get thereturned value t from printtime into main?import timefrom sched import scheduler class time_lapse(scheduler):def time

[Tutor] how to get the return value?

2006-03-04 Thread Ingo
To make a time lapse video I've been playing with the sched module. There is one problem I run into, in the code below, how do I get the returned value t from printtime into main? import time from sched import scheduler class time_lapse(scheduler): def time_lapse(self, start_time, stop

Re: [Tutor] Editing Pickled .dat files

2006-03-04 Thread ryan luna
Ohhh ok i got it to work! but why isn't the change permanent? it is "writing" to the file isn't it. --- Liam Clarke <[EMAIL PROTECTED]> wrote: > Hi Ryan, > > You're trying to use your file, dictionary.dat like > a dictionary data > structure in Python. > They don't work the same way. > > So. >

Re: [Tutor] Editing Pickled .dat files

2006-03-04 Thread Liam Clarke
Hi Ryan, You're trying to use your file, dictionary.dat like a dictionary data structure in Python. They don't work the same way. So. pickle_file = open("dictionary.dat", "r") dictionary = cPickle.load(pickle_file) pickle_file.close() elif choice == "2": pickle_file = open("dictionary.

Re: [Tutor] Pyexe

2006-03-04 Thread Alan Gauld
> Hello, Call me a complete n00b but i dont understand > how to get Pyexe to work, That's probably because py2exe isn't really aimed at beginners. Its moderately complex to use. That's because most programmers don't need it. > Iv read the site and kinda just confuses me, as you > can prolly tel

Re: [Tutor] Editing Pickled .dat files

2006-03-04 Thread ryan luna
Hey, thanks for the help but when i try i get a error Bad file descripter, here is the code im using elif choice == "2": pickle_file = open("dictionary.dat", "a") sentence = raw_input("Enter the word youd like to add: ") if sentence not in pickle_file: definitio

Re: [Tutor] Editing Pickled .dat files

2006-03-04 Thread Liam Clarke
Hi Ryan, Technically, you don't. You haul your dictionary out, as you're doing here - dictionary = cPickle.load(pickle_file) And when you're finished, you pickle it again. Regards, Liam Clarke On 3/5/06, ryan luna <[EMAIL PROTECTED]> wrote: > Hello, this is like my 3rd question today lol whi

Re: [Tutor] One shared object. class attribute or global variable?

2006-03-04 Thread Alan Gauld
> I've got a module that needs to share a pack of cards > > pack = ["14s", "2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s", "10s", > "11s", > ... > random.shuffle(pack) > > do you think it is worth making a class with just this attribute > or would this be a good place to use a global variable? Cl

Re: [Tutor] Tutorial for creating web server

2006-03-04 Thread Kent Johnson
Rakesh Mishra wrote: > Even you not clear than simply in one word I wanted to built Apache web > server in python. If you really want to write Apache from scratch in Python you have a lot of learning and a lot of work to do. A good starting point might be the book Foundations of Python Network

[Tutor] Editing Pickled .dat files

2006-03-04 Thread ryan luna
Hello, this is like my 3rd question today lol which is making up for not asking any for months =P, anyways I have a pickled .dat file named dictionary, maybe youv guessed this but its a dictionary of the Alphabet, the program is a translator right now all it does is translate the Alpabet (its a stu

Re: [Tutor] Pyexe

2006-03-04 Thread Liam Clarke
Hi Ryan, It took me about a year to cotton onto it as well. So, I wrote a script for my friend, and wanted to send it as an exe. The script I wrote was called disco_spider.py. I assume you've installed py2exe? What I then had to do was create another Python script called setup.py in the same d

Re: [Tutor] Urgent - Using Threads for processing each single Packet ?

2006-03-04 Thread Liam Clarke
Hi Sudarshana, Out of curiosity, what are you building that requires you post 500 pages to a server at once? I apologise if the question is intrusive, but I can think of a few appns that involve that, and none of them are good. Regards, Liam Clarke On 3/4/06, Sudarshana KS <[EMAIL PROTECTED]> w

Re: [Tutor] Iron Python

2006-03-04 Thread Basem Narmok
ryan luna wrote: > Hello, i have a question about Iron Python, what > exactly does it do? i know its something about .net > but i still dont understand exactly what it does, To > use it do you still write your scripts in the Python > IDLE, or what 0-o, > Hi Ryan, http://msdn.microsoft.com/msdntv/

[Tutor] Pyexe

2006-03-04 Thread ryan luna
Hello, Call me a complete n00b but i dont understand how to get Pyexe to work, Iv read the site and kinda just confuses me, as you can prolly tell im still pretty new to programming, What exactly do i have to do with pyexe to make python scripts exacutables.

Re: [Tutor] Iron Python

2006-03-04 Thread andrew clarke
On Sat, Mar 04, 2006 at 12:21:56AM -0800, ryan luna wrote: > Hello, i have a question about Iron Python, what exactly does it do? > i know its something about .net but i still dont understand exactly > what it does, To use it do you still write your scripts in the Python > IDLE, or what 0-o, It's

[Tutor] Iron Python

2006-03-04 Thread ryan luna
Hello, i have a question about Iron Python, what exactly does it do? i know its something about .net but i still dont understand exactly what it does, To use it do you still write your scripts in the Python IDLE, or what 0-o, ___ Tutor maillist - Tutor@