How to get the return status of a command runned by os.popen4

Terry Byrne TerryByrne1963 at yahoo.com
Tue Sep 4 10:57:27 EDT 2001


Alain,

I've had good luck on Windows NT 4 with the following  combination:

    cmdPipe = os.popen(aCmdLine)
    resultStream = cmdPipe.read()

At this point you can read resultStream for any stdout feedback
returned by aCmdLine. Is that what you need?

-Terry

Alain Barthe <barthe at magic.fr> wrote in message news:<3B93C945.EB6DF7A8 at magic.fr>...
> Hi,
> 
> I cannot get the return status of a command runned by os.popen4 or
> popen2.popen4. File closing does not return the status as os.popen does.
> 
> I can get it with an object popen2.popen4, but it's not Windows
> compliant.
> 
> Anybody has the solution ?
> 
> Thanks.



More information about the Python-list mailing list