read stdin NON-BLOCKING

Olivier Deme olivier.deme at airtel-atn.com
Mon Sep 24 10:37:55 EDT 2001


Hi,

How can I read the standard input in a non-blocking way?
I have tried the following, but it is still blocking:

        fcntl.fcntl(sys.stdin.fileno(), FCNTL.F_SETFD, FCNTL.O_NONBLOCK)
        os.read(sys.stdin.fileno(), bufsize)


Thanks for any help,
Olivier



More information about the Python-list mailing list