title: How does subprocess capture the output of a process with a pipe?
body: <p>What exactly does subprocess do to capture the output of the of the thing being run?</p>
  <ul>
  <li>Is it using some OS hook to direct the output into a shared ram space?</li>
  <li>Does it direct the process to write to a file on disk that it then reads? Where is the file?</li>
  <li>Network Socket?</li>
  <li>Does it do something else?</li>
  </ul>
  <pre><code>proc = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
  </code></pre>
  <p>Windows 10</p>
  <p>Python 3.7</p>