title: How to send the password after user name in command prompt using python
body: <p>Trying to run some windows application in a specific user mode. After passing the command, it will ask for password. So passing the password using proc.communicate() but its not working, Please help</p>
  
  <pre><code>from subprocess import Popen, PIPE
  import time
  cmd = "runas /user:administrator notepad.exe"
  proc = Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=PIPE)
  print proc.stdout.read()
  proc.communicate('password')
  </code></pre>