Windows command line not displaying print commands

John Machin sjmachin at lexicon.net
Tue Mar 31 03:57:03 EDT 2009


On Mar 31, 11:42 am, Terry Reedy <tjre... at udel.edu> wrote:
> 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.

What window? He's *already* in a Command Prompt window, he's typing a
command "python hello.py", and getting only a blank line and another
prompt.


>  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