title: I want to get both stdout and stderr from subprocess
body: <p>I just want to do something like this:</p>
  
  <pre><code>&gt;&gt;bar, err_value = subprocess.check_output("cat foo.txt", shell=True)
  &gt;&gt;print bar
  &gt;&gt;Hello, world.
  &gt;&gt;print err_value
  &gt;&gt;0
  </code></pre>
  
  <p>But I can't seem to be able to do it.  I can either get the stdout, the error code (via .call) or maybe both but needing to use some kind of pipe.  What am I missing here?  The documentation is very sparse about this (to me) obvious functionality.  Sorry if this is a simplistic question.</p>