title: how do i test subprocess's stdout, stderr in python on windows
body: <pre><code>&gt;&gt;&gt; import subprocess
  &gt;&gt;&gt; f = open('txt', 'w+')
  &gt;&gt;&gt; p = subprocess.Popen(['dir'],stdout=f,stderr=f, shell=True)
  &gt;&gt;&gt; p.communicate()
  (None, None) # stdout, stderr are empty. Same happens if I open a win32 gui app instead of python (don't think win32 gui apps set a stdout/stderr)
  </code></pre>
  
  <p>I want to retrieve the stdout or stderr of a <code>subprocess</code> to test a few characteristics of them (not the current <code>sys.__stdout__</code>). How can I do this from the python interpreter?</p>