Windows command line not displaying print commands
Terry Reedy
tjreedy at udel.edu
Mon Mar 30 20:42:55 EDT 2009
JonathanB wrote:
> Ok, I'm sure this is really simple, but I cannot for the life of me
> get any print statements from any of my python scripts to actually
> print when I call them from the windows command line. What am I doing
> wrong?
>
> hello.py:
> print "Hello World!"
>
> command line:
> E:\Python\dev>python hello.py
>
> E:\Python\dev>
>
>
> I'm using Python 2.6.1
I suspect that it opens the window, prints to it, and closes it in a
blink of an eye. If so, adding an input prompt after the print will
stop the window from closing until you respond to the prompt.
a = input("hit return to close")
tjr
More information about the Python-list
mailing list