read from standard input

Jaroslav Jákl j.jakl at
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 < file, i get IOError: [Errno 9] Bad file
Can anybody advise me?
Jaroslav Jakl

More information about the Python-list mailing list