title: How to write to stdin more than one times in python?
body: <p>I create a subprocess in python3.  </p>
  
  <pre><code>p = subprocess.Popen('./a', stdin=subprocess.PIPE)
  </code></pre>
  
  <p>And I want to write to it stdin.</p>
  
  <pre><code>p.stdin.write('1\n')
  do_something()
  p.stdin.write('2\n')
  </code></pre>
  
  <p>But python only support write once. What should I do?<br>
  Should I use fcntl and how to use it?</p>