title: Automate Input Into Python Prompts
body: <p>I am trying to write a python script which will execute a bash command line program for me. This program asks for user input twice, and I want my script to automatically enter "1" each time.</p>
  
  <p>I've heard of something like this:</p>
  
  <pre><code>os.system("program &lt; prepared_input")
  </code></pre>
  
  <p>How do I write prepared_input? Thanks.</p>