What's a good equivalent to python's subprocess.check_call that returns the contents of stdout?

Posted by Chris R on Stack Overflow See other posts from Stack Overflow or by Chris R
Published on 2010-05-27T19:39:35Z Indexed on 2010/05/27 19:41 UTC
Read the original article Hit count: 163

Filed under:
|

I'd like a good method that matches the interface of subprocess.check_call -- ie, it throws CalledProcessError when it fails, is synchronous, &c -- but instead of returning the return code of the command (if it even does that) returns the program's output, either only stdout, or a tuple of (stdout, stderr).

Does somebody have a method that does this?

© Stack Overflow or respective owner

Related posts about python

Related posts about subprocess