subprocess.Popen and ordering writes to stdout and stderr

Chris Withers chris at simplistix.co.uk
Thu Dec 17 16:56:54 EST 2009


exarkun at twistedmatrix.com wrote:
>> How can I get this to be the case?
> 
> You probably just need to flush stdout and stderr after each write.  You 
> set them up to go to the same underlying file descriptor, but they still 
> each have independent buffering on top of that.

Okay, but if I do:

os.system(sys.executable+' '+path)

...with test.py as-is, I get things in the correct order.

How come?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk



More information about the Python-list mailing list