Redirecting output in Windows NT

Paul Lydon google at palydon.demon.co.uk
Tue Mar 12 03:44:04 EST 2002


Running Python 2.2 on Windows NT 4 Workstation.
Suppose I have a Python program named 'splat.py' consisting of:
"print 'splat'".

If I type 'splat' and hit 'Enter', NT knows that it must run the
Python interpretor and I see 'splat' on the screen. If I redirect the
output to a file:
'splat > splat.txt', the resulting file is 0 bytes long and empty.

If I run the same program directly by typing 'python splat.py', again
I see 'splat' on the screen and when the output is redirected 'python
splat.py > splat.txt' I get a file containing the string 'splat' (as
you would expect).

Any ideas why the output redirection doesn't work in the first place?

Paul Lydon



More information about the Python-list mailing list