Redirecting output in Windows NT

Mark Hammond mhammond at skippinet.com.au
Tue Mar 12 04:03:12 EST 2002


Paul Lydon wrote:
> 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?

It is a bug in the NT command prompt.  Works OK in Win2k.  I believe 
there is a FAQ on it too.

Mark.




More information about the Python-list mailing list