Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Jeff Johnson
I wish I had a better way to represent "pennies" vs. "penny" but it works. This was a nice challenge to help me learn python. Thanks and keep them coming! My contribution: cents = 100 cost = int(round(cents * float(raw_input("Enter the cost: " tendered = int(round(cents * float(raw_input("E

Re: [Tutor] IDLE 1.2 Question

2007-08-11 Thread Luke Paireepinart
Jerry VanBrimmer wrote: > I'm using IDLE 1.2 with Python 2.5. > > My question is, when I'm coding something in an IDLE window, save the > code as a file.py, then click on Run>Run Module; and then I change > something in the code, resave the file, click on Run>Run Module again; > does this remap the

Re: [Tutor] global question

2007-08-11 Thread Alan Gauld
"Ara Kooser" <[EMAIL PROTECTED]> wrote > I am back working on a text adventure game using functions. I > broke > down the game into areas (modules) but I am having trouble getting > the > other modules to recognize the globals I have set in the main > program. Yes you can't see from a module

Re: [Tutor] global question

2007-08-11 Thread Dave Kuhlman
On Sat, Aug 11, 2007 at 03:40:18PM -0600, Ara Kooser wrote: > Hello, > >I am back working on a text adventure game using functions. I broke > down the game into areas (modules) but I am having trouble getting the > other modules to recognize the globals I have set in the main program. > If y

[Tutor] global question

2007-08-11 Thread Ara Kooser
Hello, I am back working on a text adventure game using functions. I broke down the game into areas (modules) but I am having trouble getting the other modules to recognize the globals I have set in the main program. My main program looks like this: ###

Re: [Tutor] Ingenious script (IMO) CORRECTION

2007-08-11 Thread bob gailer
bob gailer wrote: >coin = coins[idx][coinCount[deno] > 1] # CORRECTION > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread bob gailer
Dick Moores wrote: > At 07:13 AM 8/11/2007, bob gailer wrote: > >> Dick Moores wrote: >> >>> Here's the script that hands over change in the traditional way. >>> >>> >>> Is there a better way to handle the singulars and plurals? >

Re: [Tutor] LosingtheexpressivenessofC'sfor-statement?/RESENDwithexample

2007-08-11 Thread Darren Williams
If that doesn't inpire you to take up programming... nothing will. >http://99-bottles-of-beer.net/ > > :) > > Alan > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor >

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread bob gailer
Dick Moores wrote: > Here's the script that hands over change in the traditional way. > > > Is there a better way to handle the singulars and plurals? > What do you mean by "better"? More efficient? More readable/maintainable? Less cod

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread bob gailer
Dick Moores wrote: > At 07:13 AM 8/11/2007, bob gailer wrote: >> Dick Moores wrote: >>> Here's the script that hands over change in the traditional way. >>> >>> >>> Is there a better way to handle the singulars and plurals? >>> >> What do

Re: [Tutor] Installation of Django on Mac Tiger

2007-08-11 Thread David Handel
Thanks Kent. It worked. What a simple fix when you know what you are doing. There are so many people out there complaining that they spent days setting up Django on Mac Tiger. Hopefully newbies will find this post when they're feeling "terminal". Cheers, David On 8/10/07, Kent Johnson <[EMAIL

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 07:21 AM 8/11/2007, bob gailer wrote: >Dick Moores wrote: >>At 07:13 AM 8/11/2007, bob gailer wrote: >>>Dick Moores wrote: Here's the script that hands over change in the traditional way. Is there a better way to handl

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 07:13 AM 8/11/2007, bob gailer wrote: >Dick Moores wrote: >>Here's the script that hands over change in the traditional way. >> >> >>Is there a better way to handle the singulars and plurals? >> >What do you mean by "better"? >More effi

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 06:05 AM 8/11/2007, Kent Johnson wrote: >Dick Moores wrote: > > I was just about finished with a script that would tell the clerk how > > to give the change to the customer, when I discovered that the above > > script computes the wrong amount of change in certain situations. It > > works fine i

[Tutor] IDLE 1.2 Question

2007-08-11 Thread Jerry VanBrimmer
I'm using IDLE 1.2 with Python 2.5. My question is, when I'm coding something in an IDLE window, save the code as a file.py, then click on Run>Run Module; and then I change something in the code, resave the file, click on Run>Run Module again; does this remap the namespace in the Python shell? (Wh

Re: [Tutor] LosingtheexpressivenessofC'sfor-statement?/RESENDwithexample

2007-08-11 Thread R. Alan Monroe
> "Noufal Ibrahim" <[EMAIL PROTECTED]> wrote >> I think such treatment of the various python constructs should be >> reserved for documents like say, "Python for C programmers"( > Actually that's not a bad idea, except I'm not sure such convertion > courses exist? > But it would be useful to ha

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Kent Johnson
Dick Moores wrote: > I was just about finished with a script that would tell the clerk how > to give the change to the customer, when I discovered that the above > script computes the wrong amount of change in certain situations. It > works fine if the customer tenders only bills and no change,

Re: [Tutor] LosingtheexpressivenessofC'sfor-statement?/RESENDwithexample

2007-08-11 Thread Kent Johnson
Alan Gauld wrote: > "Noufal Ibrahim" <[EMAIL PROTECTED]> wrote > >> I think such treatment of the various python constructs should be >> reserved for documents like say, "Python for C programmers"( > > Actually that's not a bad idea, except I'm not sure such convertion > courses exist? > > But i

Re: [Tutor] LosingtheexpressivenessofC'sfor-statement?/RESENDwithexample

2007-08-11 Thread Alan Gauld
"Noufal Ibrahim" <[EMAIL PROTECTED]> wrote > I think such treatment of the various python constructs should be > reserved for documents like say, "Python for C programmers"( Actually that's not a bad idea, except I'm not sure such convertion courses exist? But it would be useful to have a set o

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 04:11 AM 8/11/2007, Dick Moores wrote: >I was just about finished with a script that would tell the clerk >how to give the change to the customer, when I discovered that the >above script computes the wrong amount of change in certain >situations. It works fine if the customer tenders only b

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 07:31 AM 8/6/2007, Dick Moores wrote: >At 06:49 AM 8/6/2007, Kent Johnson wrote: > >Dick Moores wrote: > >>http://www.rcblue.com/Python/changeMaker_revised_for_US_denominations.py > >>I'm still working at Python--been at it a while--and thought the > >>script was ingenious. Do the Tutors agree?

Re: [Tutor] Losing theexpressivenessofC'sfor-statement?/RESENDwithexample

2007-08-11 Thread Noufal Ibrahim
Stephen McInerney wrote: > Hi Alan, [..] > How can we address that reasonably and succinctly without polluting the doc > with language-migration-specific details, that is a worthy question... I > believe we can do a better job simply by grouping and highlighting related > alternative concepts li

Re: [Tutor] WinPdb?

2007-08-11 Thread Dick Moores
At 04:31 PM 8/9/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > The only debugging I've done so far is to put in print statements > > where I want to see what's happening. > >Thats OK for basic stuff but for complex things you can wind up >with an awful lot of printing going

[Tutor] Opinions about this new Python book?

2007-08-11 Thread Dick Moores
Title: Python Power!: The Comprehensive Guide Author:  Matt Telles Publisher:  Course Technology Pub. Date:  Jul 27, 2007 Edition:  1st edition Binding:  Paperback Pages:  508 ISBN:  1598631586 List Price:  34.99 USD < http://www.bestbookdeal.com/book/compare/1598631586> Thanks, Dick Moo

Re: [Tutor] Losing the expressivenessofC'sfor-statement?/RESENDwithexample

2007-08-11 Thread Stephen McInerney
Hi Alan, I appreciate your very thoughtful answer. I had previously thought you were not taking the intent of my question seriously, it did seem to have strayed hopelessly offtopic (e.g. I knew all about Python's quicksort() already, but the generic question about for-loops very much stands).