title: How to make python script press 'enter' when prompted on Shell
body: <p>I want to automatize upgrade of a program.</p>
  
  <p>I run in Python this code:</p>
  
  <pre><code>import subprocess
  subprocess.call('./upgrade')
  </code></pre>
  
  <p>When I do this, I get output from shell that Upgrade procedure started successfully, and then I get 'Press Enter to continue'. How would I automatize this process, so that python script automatically "presses" enter when promted? I need this to be done twice during procedure. 
  I need this to be done on Linux, not Windows, as it was asked here:
  <a href="https://stackoverflow.com/questions/13564851/generate-keyboard-events">Generate keyboard events</a>
  Also, this needs to be done specifically after Shell prompts for Enter.
  Thanks for any help. 
  I did not find solution here:
  <a href="https://stackoverflow.com/questions/15639064/press-enter-as-command-input">Press enter as command input</a></p>