[Tutor] Python Versions

earlylight publishing earlylightpublishing at yahoo.com
Thu Dec 13 07:38:18 CET 2007

Actually the first thing I noticed is the author would say something like "you can run the program by pressing F5 or selecting "run program" from the "run" menu.  Neither of those things work from the shell.  Saving programs also didn't work well for me when I put them in the shell.  Do people really write whole applications just using the shell?  
  "earlylight publishing" <earlylightpublishing at yahoo.com> wrote

>I have the latest python version too when I first started "A Byte of 
> my code wouldn't work either.  My problem was that I was programming
> in the shell (the screen with the three '>>>' on it).  I found when 
> I wrote
> the examples in a new window (cntrl+N) they all worked as 
> advertized.

Unless you are doing some strange GUI type things it should work at
the >>> prompt too. (Sometimes you need an extra line - that could
fox beginners I suspect, if his examples contain multiple statements)

> He never mentions that you need to use an 'editing window'
> (I think it's called).  I just stumbled across the fact.

You shouldn't need to use an editing window, but the >>> prompt
does execute each line 9or block) in turn thus:

for n in range(5):
    x = n+x
print x

looks like this in IDLE:

>>> x=0
>>> for n in range(5):
    x = n+x
                                            <--Extra line here!
>>> print x

Is that the kind of thing you are seeing?

Never miss a thing.   Make Yahoo your homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071212/d8a2fb3a/attachment.htm 

More information about the Tutor mailing list