using sys.stdin.raw_input and sys.stdin.readline together in a platform independent way

Mike Carifio carifio.nospam at nospam.usys.com
Mon Feb 4 17:45:38 EST 2002


In "Programming Python" by Lutz, 2nd Ed, pp. 50-51, he indicates that if
you're
reading input from sys.stdin which has been redirected from a file, then
sys.stdin.raw_input
will be confused and will also read from that file. He then goes on to
implement a
function getreply() which will figure out how to get a character from the
console.
Is there now a platform independent way to do this in python 2.2? Pl. advise
at
your convenience. Thanks.






More information about the Python-list mailing list