[Tutor] Runs in IDLE with F5, but not in Windows Command Prompt
boB Stepp
robertvstepp at gmail.com
Thu Apr 25 16:07:12 CEST 2013
On Thu, Apr 25, 2013 at 8:45 AM, Marc Tompkins <marc.tompkins at gmail.com> wrote:
> On Thu, Apr 25, 2013 at 5:40 AM, boB Stepp <robertvstepp at gmail.com> wrote:
> Remember that input(), in Python 2, executes what's passed to it. If your
> input is boB, then Python tries to execute the statement boB - and unless
> you've previously defined boB, Python doesn't know what to do with it.
>
Thanks, Marc. What little studying I have done to date has been
strictly Python 3.x based. I try to pay attention to what is discussed
in this forum and had absorbed that in 2.x I should use raw_input()
for what I am doing in my program. I did not recall absorbing any
discussion of how input() works in 2.x. Of course, I was only
beginning to suspect that the command prompt was running my .py files
in 2.7 when I sent my post late yesterday evening. What you say
combined with one of the earlier answers makes it much clearer to me
why using input() in 2.x can allow a user to do things that I would
not want him/her to do!
boB
More information about the Tutor
mailing list