title: pexpect to pass password to a script
body: <p>I'm trying to run a code which will trigger a script.
  The script evaluates something and uploads the results to a site for which it prompts password from user. Need to automate this with a generic user.</p>
  
  <p>I have </p>
  
  <pre><code>import subprocess
  p=subprocess.Popen(cmd,cwd=path)
  p.wait()
  </code></pre>
  
  <p>When this runs, it evaluates something and prompts for password.
  How to give this password using pexpect?
  Is there any other solution to it?</p>