0

I am struggling with a challange in python. I have an idea that my script must evoke an executable file. I am able to pass this executable a username, but what comes to password I need to enter it manually in command line. I want to automate the application, so I dont enter it manually every time. Here is the script. I run it under Windows.

`
import subprocess 

p = subprocess.Popen(".\executable.exe --user domain\user", stdin=subprocess.PIPE, shell=True)

p.communicate(input="Mypassword")`
ChaosPredictor
  • 3,777
  • 1
  • 36
  • 46
  • You could use pexpect. Pretty powerful tool for this type of automation. – BoboDarph Oct 18 '18 at 09:38
  • Thank you, trying to run it with the pexpect I still get to the point where the executable pops out the request to input the password – Vic Zagranowski Oct 18 '18 at 09:58
  • Well then capture it and send it the password. That's the whole point of using pexpect. See examples in documentation or other stackoverflow questions like this one: https://stackoverflow.com/questions/42557671/how-do-i-capture-password-prompt – BoboDarph Oct 18 '18 at 10:03

0 Answers0