stdout and redirection (win NT)

Craig Findlay craigf at ilid.com.au
Tue Mar 21 04:06:42 CET 2000


What am I doing wrong here?

My sample python program test.py is:

import sys
sys,stdout.write('Hello World')

>From a command prompt, I type:
test.py
and I get the expected Hello World output on the console.

Next, I type:
test.py > c:\myfile.txt

I expect the file myfile.txt to contain the redirected output from the
python script. Instead, myfile.txt exists but is empty.

What is happening?

Craig Findlay



More information about the Python-list mailing list