title: Python subprocess redirect
body: <p>I have python subprocess created like this:</p>
  
  <pre><code>sub = subprocess.Popen(['./binary'], stdin = subprocess.PIPE, stdout = subprocess.PIPE)
  </code></pre>
  
  <p>I want to:</p>
  
  <ol>
  <li>Send some input to the subprocess and get some output from it,</li>
  <li>Redirect the stdin to subprocess stdin and subprocess stdout to stdout,</li>
  <li>Let the user talk with the subprocess freely, like if the user launched the subprocess himself.</li>
  </ol>
  
  <p>I'm aware that process can be created with it's stdout redirected to the parent stdout for example <code>ls=subprocess.Popen(['ls'])</code> will print subprocess' output to stdout. Can it be done to stdin? Can it be done with running process?</p>