title: Send commands to subprocess.Popen() process
body: <p>I need to pass commands to a process on <code>subprocess.Popen()</code> but when I do, it only works if I use <code>stdin.close()</code> afterwards. My code is below.</p>
  
  <pre><code>sprocess.stdin.write('/stop'.encode())
  sprocess.stdin.flush()
  sprocess.stdin.close()
  sprocess.stdout.close()
  </code></pre>
  
  <p>Works, but that is because of <code>stdin.close()</code> and I need to be able to do this without closing the pipes.</p>
  
  <p>How can I pass commands to the process without closing the pipes after?</p>