exit status from a pipe

U

user

How can I get the exit status from a "popen2" pipe?
For example, from

child_stdout, child_stdin, child_stderr = popen2.popen3(command)

how can I tell what the exit status it?
Want to find out if a command actuall succeeded.
 
A

Albert Hofkamp

How can I get the exit status from a "popen2" pipe?
For example, from

child_stdout, child_stdin, child_stderr = popen2.popen3(command)

how can I tell what the exit status it?

Straight from the online manual:

The only way to retrieve the return codes for the child processes is by
using the poll() or wait() methods on the Popen3 and Popen4 classes;
these are only available on Unix. This information is not available when
using the popen2(), popen3(), and popen4() functions, or the equivalent
functions in the os module.


Most if not all of the answers to such question are available in the
(very good) Python documentation.



Albert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top