Try
proc.stdin.write('yourPassword\n')
proc.stdin.flush()
That should work.
What you describe sounds like stdin=None
where the child process inherits the stdin of the parent (your Python program).
More Related Contents:
- Using module ‘subprocess’ with timeout
- read subprocess stdout line by line
- Python: execute cat subprocess in parallel
- Python threading multiple bash subprocesses?
- Calling a python script with input within a python script using subprocess
- SFTP in Python? (platform independent)
- Difference between subprocess.Popen and os.system
- Python popen command. Wait until the command is finished
- How can I specify working directory for popen
- Multiple pipes in subprocess
- File not found error when launching a subprocess containing piped commands
- subprocess readline hangs waiting for EOF
- Run child processes as different user from a long running Python process
- Run Process and Don’t Wait
- How to kill a python child process created with subprocess.check_output() when the parent dies?
- Python subprocess and user interaction
- How to suppress or capture the output of subprocess.run()?
- How to run a background process and do *not* wait?
- How to parallelize file downloads?
- Sending a password over SSH or SCP with subprocess.Popen
- Communicate multiple times with a process without breaking the pipe?
- Python – how to execute shell commands with pipe, but without ‘shell=True’?
- What can lead to “IOError: [Errno 9] Bad file descriptor” during os.system()?
- Launch a python script from another script, with parameters in subprocess argument
- Python: subprocess call with shell=False not working
- Python subprocess.Popen as different user on Windows
- Bash style process substitution with Python’s Popen
- Execute Subprocess in Background
- How can I spawn new shells to run Python scripts from a base Python script?
- Opening a process with Popen and getting the PID