Should I use threads here?

Steve Holden sholden at holdenweb.com
Wed Nov 28 17:41:52 EST 2001


"Kragen Sitaker" <kragen at pobox.com> wrote in ...
> "Steve Holden" <sholden at holdenweb.com> writes:
> > readlines() doesn't terminate until it knows (by seeing and end of file
on
> > its input stream) that it has read all the input. If you built a loop
using
> > readline() you might find you got better results.
>
> This is assuming that the program actually outputs stuff as it goes;
> many programs buffer output in big blocks when they're talking down a
> pipe instead of outputting line by line.
>
This may be true. But the readline() solution *can't* be any worse, and
might be better. Readlines() will definitely not return until the called
program closes its standard output. Of course, if Era has no access to the
program's source he has no possibility of adjusting its output behavior.

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list