I'm trying to run an
from subprocess import Popen, PIPE
proc = Popen(['scp', "[email protected]:/foo/bar/somefile.txt", "."], stdin = PIPE)
[email protected]'s password:
Permission denied, please try again.
The second answer you linked suggests you use Pexpect(which is usually the right way to go about interacting with command line programs that expect input). There is a fork of it which works for python3 which you can use.