Redirecting stdin/stdout on Windows with '>'and '<'

Mark markmcmahon at my-deja.com
Mon Apr 10 12:28:50 EDT 2000


Hi,

I seem to have a problem and can't find it in the archives or FAQ.

I would like to redirect output of my script with '>' or '<'

If I try to redirect out then the file is created but has no contents.

If I try to redirect in eg...
"test.py < autoexec.bat"

I get the following traceback

Traceback (most recent call last):
  File "C:\test.py", line 4, in ?
    s = sys.stdin.read()
IOError: [Errno 9] Bad file descriptor

Does anybody have an idea!!!

(Windows nt 4 sp 6, python 1.52)

Thanks
  Mark


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list