stdout and redirection (win NT)

Craig Findlay craigf at
Tue Mar 21 04:06:42 CET 2000

What am I doing wrong here?

My sample python program is:

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

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

Next, I type: > 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