sys.stdin.read question

Grant Edwards grante at visi.com
Tue Dec 7 16:26:32 EST 2004


On 2004-12-07, It's me <itsme at yahoo.com> wrote:
> Why do I get an "AttributeError: read" message when I do:
>
>     import sys
>     r=sys.stdin.read()

Dunno. Works fine for me under 2.3.4, and according to the
docs, should work under 2.4.

What do you get when you do this:

 import sys
 type(sys.stdin)
 dir(sys.stdin) 

> Some sample code I saw uses this function in the same manner I
> am and so I am assuming this is the correct syntax?

Should be.

> Or is this a bug in Python 2.4?

That would be a little hard to believe.

-- 
Grant Edwards                   grante             Yow!  PEGGY FLEMMING is
                                  at               stealing BASKET BALLS to
                               visi.com            feed the babies in VERMONT.



More information about the Python-list mailing list