get text from rogramms runn by subprocess.Popen immediatetly

Piet van Oostrum piet at
Fri Apr 17 11:05:31 CEST 2009

>>>>> Rüdiger Ranft <_rdi_ at> (RR) wrote:

>RR> Hi all,
>RR> I need to call some programms and catch their stdout and stderr streams.
>RR> While the Popen class from subprocess handles the call, I get the
>RR> results of the programm not until the programm finishes. Since the
>RR> output of the programm is used to generate a progress indicator, I need
>RR> a way to acces the values written to stdout/stderr as fast as possible.

>RR> print

Use p.stderr.readline() or in a loop.
Piet van Oostrum <piet at>
URL: [PGP 8DAE142BE17999C4]
Private email: piet at

More information about the Python-list mailing list