That doesn't seem to work neither.
from subprocess import * p = Popen("Command that does something and asks for a password",stdin=PIPE, stdout=PIPE, shell=True) p.communicate(b"secret password\r\n")
Output:C:\>python subprocess_test.py
Enter password:
Verify password: