Sep-03-2018, 10:58 AM
I tried:
from subprocess import * p = Popen('Command that does something and asks for a password', stdin=PIPE, stdout=PIPE, shell=True) p.stdin.write(b"secret password\r\n" * 2)
Output:C:\>python subprocess_test.py
The process tried to write to a nonexistent pipe.
The process tried to write to a nonexistent pipe.
The process tried to write to a nonexistent pipe.
The process tried to write to a nonexistent pipe.
The process tried to write to a nonexistent pipe.
....
The answer I've got was that line repeated over and over a bunch of times.