Use subprocess to send a password
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).
from subprocess import Popen, PIPEproc = Popen(['sftp','user@server', 'stop'], stdin=PIPE)proc.communicate(input='password')
Try with input=‘password’ in communicate, that worked for me.