Blocking read on pipes

Arnau Sánchez arnau at gbt.tfo.upm.es
Fri Jul 16 08:21:45 EDT 2004


>Python's file.read() corresponds most closely to C's fread(3).
>Python's os.read() corresponds most closely to POSIX's read(2).

>Maybe you want
>    os.read(0, 256)
>instead of 
>    sys.stdin.read(256)

Thanks for your help, Jeff, you are right. I erroneously thought that reading from stdin
was the same than an os's read. Now it works.

arnau





More information about the Python-list mailing list