non-blocking sys.stdin.read() on win32?

Jason Orendorff jason at jorendorff.com
Sun Jan 20 20:39:32 EST 2002


Michal Wallace wrote:
> I want to just be able to call select() on sys.stdin and
> then, if appropriate, read more than one line of, but it
> doesn't let me, because on win32, python's select() only
> works for sockets.

Use two threads: one with a read/send loop and one with
a recv/write loop.

Another possibility is win32event.  But that can get rather
involved.

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list