title: Communicating multiple times with a subprocess
body: <p>I'm trying to pipe input to a program opened as a subprocess in Python.  Using communicate() does what I want, but it only does so once, then waits for the subprocess to terminate before allowing things to continue.</p>
  <p>Is there a method or module similar to communicate() in function, but allows multiple communications with the child process?</p>
  <p>Here's an example:</p>
  <pre><code>import subprocess
  
  p = subprocess.Popen('java minecraft_server.jar',
                   shell=True,
                   stdin=subprocess.PIPE);
  
  //Pipe message to subprocess console here
  
  //Do other things
  
  //Pipe another message to subprocess console here
  </code></pre>
  <p>If this can be done in an easier fashion without using subprocess, that would be great as well.</p>