FAQ
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.

Search Discussions

  • Albert Hofkamp at Oct 30, 2003 at 3:41 pm

    On Thu, 30 Oct 2003 12:19:22 +0200, user at domain.invalid wrote:
    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
    --
    Unlike popular belief, the .doc format is not an open publically available format.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 30, '03 at 10:19a
activeOct 30, '03 at 3:41p
posts2
users2
websitepython.org

2 users in discussion

Albert Hofkamp: 1 post User: 1 post

People

Translate

site design / logo © 2022 Grokbase