Joining stdout & stderr of subprocess ?

Piet van Oostrum piet at cs.uu.nl
Fri Apr 21 08:13:57 EDT 2006


>>>>> robert <no-spam at no-spam-no-spam.com> (R) wrote:

>R> when I run a command

>R> myapp 2>&1


>R> yet:

>R> #!python
>R> print os.popen("myapp 2>&1").read()

>R> the stderr stuff comes all after the stdout stuff.
>R> How can I get ahold of all the out and err joined synchronously in the
>R> order, it is created ?


Make sure that myapp writes it synchronously. Probably myapp has it
buffered, so it writes out at the end of the run. It is not caused by
python. 

-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list