I would like to execute a command (ex: myprogram.exe) in a python script.
the OS is windows 10: Normally, when i execute mycommand.exe in a terminal , it opens another popup windows which prompts the user to enter a credentials (ID and password).
the operation is as follows in command line:
- bin> myprogram.exe arg1 arg2;
- (windows open a popup with this message : do you want to allow this app to make changes to your device? -- Yes / no) => user clic yes );
- another terminal opens which prompts the user to enter Id and password;
- after hitting enter, mycommand.exe does its job..
Now, I would like to automate this tasks with python script. I use this function with subprocess module:
def myfunc():
command = "..\\bin\\myprogram.exe backup file"
subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr = subprocess.PIPE)
return "done!"
but as i am new to python, i do not know how to handle the pop up windows that I mentioned above.
need help
I thank you in advance,