popen in real time?

William Annis annis at biostat.wisc.edu
Tue Jun 6 14:35:21 EDT 2000


msoulier at nortelnetworks.com (Michael P. Soulier) writes:

> 	Hey guys. I realize that you can loop on the output of popen
> if you want to read from a pipe, but it would seem from experience
> that the output of the child process is not available until the
> process exits. I've tried this with the output of long-running
> processes like find. Is there a way to get the output of a child in
> real time, as it's printed?

        I've found using the Popen3 class in popen2 to be very helpful
in these cases... turn off the buffering by setting the bufsize option
to zero.

-- 
William Annis - System Administrator - Biomedical Computing Group
annis at biostat.wisc.edu                       PGP ID:1024/FBF64031
Mi parolas Esperanton - La Internacian Lingvon  www.esperanto.org



More information about the Python-list mailing list