title: Python pexpect not working as expected
body: <p>Im trying to write a program that runs some shell commands wit emulated user data.</p>
  
  <p>The problem is that the shell command does not run correctly without this line in the end of the code:</p>
  
  <pre><code>raw_input('press &lt;enter&gt; to exit')
  </code></pre>
  
  <p>How can i get rid of that line?</p>
  
  <pre><code>child = pexpect.spawn('grunt init:gruntfile')
  child.logfile_read = sys.stdout
  
  child.expect ('Is the DOM involved in ANY way?')
  child.sendline ('y')
  child.logfile_read = sys.stdout
  
  child.expect ('Will files be concatenated or minified?')
  child.sendline ('y')
  child.logfile_read = sys.stdout
  
  child.expect ('Will you have a package.json file?')
  child.sendline ('y')
  child.logfile_read = sys.stdout
  
  child.expect ('Do you need to make any changes to the above before continuing?')
  child.sendline ('n')
  child.logfile_read = sys.stdout
  
  raw_input('press &lt;enter&gt; to exit')
  </code></pre>