Reading pipes in Python

Jeroen van der Ham jeroen_ at _os3.dot.nl
Sat Dec 6 20:53:38 CET 2003


On Sat, 06 Dec 2003 18:42:35 +0100, Rene Pijlman
<reply.in.the.newsgroup at my.address.is.invalid> wrote:
>
>This loop is endless, so don't complain to us that it doesn't end :-)
>
>>what can be done to make it work?
>
>f=open('ff','r')
>while 1:
>    li = f.readline()
>    if not li: break
>    print li,

This works, but only for a single line.

The idea is that the pipe takes the place of a log of an application
so that the script can do something because something is written to
the log.

Jeroen.





More information about the Python-list mailing list