read from standard input

Jaroslav Jákl j.jakl at era.cz
Fri Aug 9 16:04:31 CEST 2002


Hi all,
I want to read from stdin. I have the following script:

import sys
for line in sys.stdin.readlines():
    print line

and if i execute it like script.py < file, i get IOError: [Errno 9] Bad file
descriptor.
Can anybody advise me?
thanks
Jaroslav Jakl






More information about the Python-list mailing list