get text from rogramms runn by subprocess.Popen immediatetly

Diez B. Roggisch deets at nospam.web.de
Thu Apr 16 08:09:48 EDT 2009


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

Use the communicate()-method of Popen-objects.

Diez



More information about the Python-list mailing list