title: python subprocess: check to see if the executed script is asking for user input
body: <pre><code>import subprocess
  
  child = subprocess.Popen(['python', 'simple.py'], stdin=subprocess.PIPE)
  child.communicate('Alice')
  </code></pre>
  
  <p>I know you can communicate with executed script via communicate
  How do you check for whether a script 'simple.py' is asking for user input?</p>
  
  <p>simple.py could ask for 5-10 user inputs so simply hardcoding <code>communicate</code> wouldnt be enough. </p>
  
  <p>[EDIT]: want to parse the stdout as the script is running and communicate back to the script </p>
  
  <pre><code>while True:
      if child.get_stdout() == '?':
         # send user input
  </code></pre>