Problem using popen2/popen3

jurgen.defurne at philips.com jurgen.defurne at philips.com
Thu Aug 31 04:45:37 EDT 2000


I am using these functions to control a separate process, which is done normally through the command line.

I have used popen for this, which works fine, but I also want to catch the standard error output. If an error occurs, the exit status is 1 and that's it.

Using popen3 I was able to do what I wanted, but from the documentation it is not clear how I can get the
exit status (sometimes the result is an error message, but with exit status 0).

The documentation on popen2/popen3 is contradictory here. The factory functions popen2/popen3 return 2 or three pipe objects, bot lower in the text it is stated that 'Popen3 instances are created using the factory functions described above'.

This seems contradictory to me. Any ideas or explanations ?

Jurgen



More information about the Python-list mailing list