title: How to make stdout and stderr work for command used by other application?
body: <p>I would like to use stdout and stderr to determine if there's some error message used by a command provided by some other application. I can make it work for system command such as below. </p>
  
  <pre><code>size_permission = Popen([ "ls" , "-l" , '/home/jnh.txt' ] , stdout=subprocess.PIPE , stderr=subprocess.PIPE)
  </code></pre>
  
  <p>If the file /home/jnh.txt does not exists, there's an output in stderr as shown below:</p>
  
  <pre><code>&gt;&gt;&gt; for tst in size_permission.stderr:
  ...  print tst
  ...
  ls: /home/bta/jnh.txt: No such file or directory
  </code></pre>
  
  <p>Then the stdout does not have any output which is expected.</p>
  
  <pre><code>&gt;&gt;&gt; for tst in size_permission.stdout:
  ...  print tst
  ...
  </code></pre>
  
  <p>Now, I want to have the same behavior with other applications command. I tried but even if the "other application command" has an error message, there's always an output in stdout instead in stderr ? Is there a way to make this work?</p>
  
  <p>Thanks</p>