[Tutor] interactive mode questions
Alan Gauld
alan.gauld at btinternet.com
Fri Dec 25 23:46:40 CET 2009
"rick" <rdole1 at cogeco.ca> wrote
> while True:
> reply = input('Enter text:')
> if reply == 'stop': break
> print(reply.upper())
>
> which works "as advertised" in an interactive session, but not in a
> script. Yes, I tried tossing the script to both versions of
> interpreter, it doesn't work with either 2.6 or 3.1.
Somehow you are picking up an older v2 interpreter.
How are you running the script?
>From within IDLE? Or from an OS command?
If the latter try using the full path to the v3 Python interpreter.
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list