Re: [Tutor] using in over several entities

2007-08-25 Thread Tino Dai
On 8/24/07, Chris Calloway <[EMAIL PROTECTED]> wrote Thanks everybody for their assistance! Makes my code a lot more elegant. -Tino ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question about classes

2007-08-25 Thread Kent Johnson
Ara Kooser wrote: > Hello all, > >I am working on trying to understand classes by creating a > character generator for a rpg. I know I am doing something silly but I > am not sure what. This is a procedural program wrapped in a class declaration. Just get rid of "class Main:" and outdent ev

Re: [Tutor] Question about classes

2007-08-25 Thread Alan Gauld
"Eric Abrahamsen" <[EMAIL PROTECTED]> wrote >> Welcome to the wacky world of recursion. >> You call __upp from inside __upp so you do indeed generate >> a new layer, in fact you start a new while loop. You need to > > So all those "yes"s were actually backing out of multiple while > loops... Shoul

Re: [Tutor] Question about classes

2007-08-25 Thread Eric Abrahamsen
> Welcome to the wacky world of recursion. > You call __upp from inside __upp so you do indeed generate > a new layer, in fact you start a new while loop. You need to > move the while loop out into init, something like this: So all those "yes"s were actually backing out of multiple while loops..

Re: [Tutor] Question about classes

2007-08-25 Thread Alan Gauld
"Eric Abrahamsen" <[EMAIL PROTECTED]> wrote > The new problem is the while loop inside __upp. Every time I say > "no", and it generates a new set of attributes, it seems to add > another "layer" of unfinished = True, so that once I've got > attributes I like, I need to say "yes" as many times as

Re: [Tutor] Help Request: Nested While commands

2007-08-25 Thread Luke Paireepinart
Paul W Peterson wrote: > > Greeting! Greeting. Can you please make a new message next time you post to the list, instead of replying to an existing message and changing the subject line? There is more to an e-mail than just the subject, and threaded mail clients notice whether an e-mail is comple

Re: [Tutor] Question about classes

2007-08-25 Thread Eric Abrahamsen
On Aug 25, 2007, at 12:59 PM, Ara Kooser wrote: > Hello all, > >I am working on trying to understand classes by creating a > character generator for a rpg. I know I am doing something silly but I > am not sure what. When I run the program I and type no when prompted I > get the following messa

Re: [Tutor] A fun puzzle

2007-08-25 Thread Luke Paireepinart
Dick Moores wrote: > At 12:12 PM 8/24/2007, Kent Johnson wrote: >> Dick Moores wrote: >>> At 10:22 AM 8/24/2007, Kent Johnson wrote: So you actually pasted that code into timeit.py? >>> Yeah. :-( I think I learned on the Tutor list to do it that way, but >>> I'm not sure. Thanks for showing m

Re: [Tutor] Question about classes

2007-08-25 Thread Alan Gauld
"Ara Kooser" <[EMAIL PROTECTED]> wrote > I am working on trying to understand classes by creating a > character generator for a rpg. You are so ar off base at the moment that I suggest you go back to basics and try a much simpler class. Your MAIN is not really a class at all, it's a function

Re: [Tutor] Read dictionary data in a specific order...

2007-08-25 Thread Alan Gauld
"Trey Keown" <[EMAIL PROTECTED]> wrote I just spotted something. > for (tag,val) in attrs.iteritems(): >for tag in window_attrs_key_order: > print "%s%s = Tk()" %(whitespace, val) etc... You set tag and val in the outer loop, then you change tag in the innrter loop but you never chan

Re: [Tutor] Read dictionary data in a specific order...

2007-08-25 Thread Alan Gauld
"Trey Keown" <[EMAIL PROTECTED]> wrote > window_attrs_key_order = ["name", "title", "icon"] > for (tag,val) in attrs.iteritems(): > for (tag,val) in attrs.iteritems(): > if tag in window_attrs_key_order: > for tag in window_attrs_key_order: > if tag == u"name": > print

Re: [Tutor] Spawning terminals from Python - A failed question

2007-08-25 Thread Luke Paireepinart
wormwood_3 wrote: >>> Umm, so just put the ampersand at the end of the command string and >>> call os.system() >>> > > Not sure what the point of this variation would be if os is being deprecated > along with commands... > He was pointing out that you already had a workable solution with