Re: [Tutor] Case ?

2005-07-05 Thread Liam Clarke
Ah, the cascading broken case statement of doom. On 7/6/05, Danny Yoo <[EMAIL PROTECTED]> wrote: On Tue, 5 Jul 2005, Mike Cheponis wrote:> Why does Python not have a "case" statement, like C?Hi Mike,It's a proposed enhancement: http://www.python.org/peps/pep-0275.htmlThat being said, a dispatch

Re: [Tutor] I sure do love cookies.

2005-07-05 Thread Liam Clarke
Denise - Create a cookie, save it, load it as a cookie jar (using cookielib), create an URLopener using urllib2 that uses the cookiejar, do your thing. Remember that sending a cookie/receiving a cookie client side is initiated by the server, so you just have to have the cookie present. The tech

Re: [Tutor] [pygame] Fwd: A more Pythonic way to do this

2005-07-05 Thread R. Alan Monroe
> should be returning each to its original starting position. Since I > create initialx/initialy for each enemy when the screen full of > enemies is drawn (and I know I do create a new initialx/initialy for > each one - because I had it print the initialx, initialy when the > screen was drawn and I

[Tutor] Fwd: A more Pythonic way to do this

2005-07-05 Thread D. Hartley
This question began on the tutor mailing list, but I am now seeing that it is pygame-specific, so I am forwarding it here as well. I apologize if anyone gets a duplicate post. As it turns out, my "holder" classes are all subclasses of type RenderClear (which it says is "basic Group class you will

Re: [Tutor] I sure do love cookies.

2005-07-05 Thread Kent Johnson
D. Hartley wrote: > Thank you for the code, everyone. > > I actually have a piece of information (something like > "this+is+a+cookie") that I am trying to *send* (not receive), and I'm > not sure how to do it. I looked at the Cookie examples a little bit, > but am having trouble applying what I s

Re: [Tutor] Handling Unpickled Data

2005-07-05 Thread Don Parris
On 7/5/05, Don Parris <[EMAIL PROTECTED]> wrote: > Greetings, > > I have a script that gets a little info from the user, using a > dictionary, which I then store in a file via cPickle. This pickle > concept must be good for something, but I haven't figured out exactly > what just yet. At any rat

[Tutor] Handling Unpickled Data

2005-07-05 Thread Don Parris
Greetings, I have a script that gets a little info from the user, using a dictionary, which I then store in a file via cPickle. This pickle concept must be good for something, but I haven't figured out exactly what just yet. At any rate, I would like to now get the code and be able to display on

Re: [Tutor] I sure do love cookies.

2005-07-05 Thread D. Hartley
Thank you for the code, everyone. I actually have a piece of information (something like "this+is+a+cookie") that I am trying to *send* (not receive), and I'm not sure how to do it. I looked at the Cookie examples a little bit, but am having trouble applying what I see there to my present situati

Re: [Tutor] Case ?

2005-07-05 Thread Danny Yoo
On Tue, 5 Jul 2005, Mike Cheponis wrote: > Why does Python not have a "case" statement, like C? Hi Mike, It's a proposed enhancement: http://www.python.org/peps/pep-0275.html That being said, a dispatch-table approach, using a dictionary, works well in Python because it's not hard to u

[Tutor] Case ?

2005-07-05 Thread Mike Cheponis
Why does Python not have a "case" statement, like C? Thanks! -Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] more() method of asynchat

2005-07-05 Thread Johan Geldenhuys
Hi all, I am trying to use the asynchat and asyncore modules in the documentation it says that one must create the producers (connection) own more() method. What does this do and do I need to have it? Thanks, Johan ___ Tutor maillist - Tutor@py

Re: [Tutor] Initialising attributes with random values

2005-07-05 Thread Pujo Aji
use : random.randint(1,5) so complete code will be: class something: def __init__(self, name): self.name = name self.size = random.randint(1,5) self.strength = random.randint(1,5) pujo On 7/5/05, Max Russell <[EMAIL PROTECTED]> wrote: > Hello there; > > If I hav

[Tutor] Initialising attributes with random values

2005-07-05 Thread Max Russell
Hello there; If I have a class and want to initalise it, with random values assigned to the attributes, what is the best way of doing this? For example: def __init__(self, name, size = 0, strength = 0): self.name = name self.size = size self.strength = strength start

Re: [Tutor] "And" function

2005-07-05 Thread geon
gordnjen napsal(a): Message I need to write a program that will do the following:   Ask the user's age. If their age is below 1 yr old, it prints "you are old enought to eat baby food" If they are over 16, it prints "You are old enough to drive" If they are over 65, it p

Re: [Tutor] "And" function

2005-07-05 Thread Brian van den Broek
gordnjen said unto the world upon 04/07/2005 22:24: > I need to write a program that will do the following: > > Ask the user's age. > If their age is below 1 yr old, it prints "you are old enought to eat baby > food" > If they are over 16, it prints "You are old enough to drive" > If they are ove

[Tutor] "And" function

2005-07-05 Thread gordnjen
I need to write a program that will do the following:   Ask the user's age. If their age is below 1 yr old, it prints "you are old enought to eat baby food" If they are over 16, it prints "You are old enough to drive" If they are over 65, it prints "You are old enough to drive" and "You are

Re: [Tutor] What's wrong with this code?

2005-07-05 Thread Brian van den Broek
Andre Engels said unto the world upon 05/07/2005 02:44: >>From the program:: > > answer = raw_input("What is the password? ") > while password != answer: > print "The password is incorrect." > I think you intended to make it so that > the program kept asking for passwords until the right on