Reading pipes in Python

Rene Pijlman at
Sat Dec 6 21:17:09 CET 2003

Jeroen van der Ham:
>Rene Pijlman:
>>while 1:
>>    li = f.readline()
>>    if not li: break
>>    print li,
>This works, but only for a single line.

No, it works for multiple lines as well.

What you probably mean is: it works only for a single writer process. This
is what Linus said about it in 1993: "That's how a fifo is supposed to
work as far as I can tell: when all writers have exited, the reader gets
an EOF and also exits.."

Try 'cat' instead of a Python script and you'll see exactly the same

René Pijlman

More information about the Python-list mailing list