Error using sys.stdin.read()

curtissol at my-deja.com curtissol at my-deja.com
Tue Jan 2 00:37:36 EST 2001


Any attempt to use the attribute "read" as in:

import sys
    while 1:
        next = sys.stdin.read()     # read a one-character string
        if not next:                 # or an empty string at eof
            break
    #process "next"

fails on the use of "sys.stdin.read()" with the message:

"AttributeError: 'PyShell' instance has no attribute 'read' "

I am using Python 2.0 on NT 4.5 on a PC. It's as if 'read' does not
exist.

Thank you




Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list