[Tutor] sftp using subprocess

Asad asad.hasan2004 at gmail.com
Mon Dec 3 17:01:53 EST 2018


Hi All ,

        I am looking for a solution to automate downloading file using sftp
process using :

batch.txt :contains the following two lines
cd 12345678
get 12345678_1.zip


import subprocess
host="abc.com"
user="sa"
user_host="%s@%s" % (user, host)
sftp_process = subprocess.Popen(['sftp', '-b', 'batch.txt', user_host],
shell=False)

however it gives error even unable to provide password .

Please advise.

Thank you,
-- 
Asad Hasan
+91 9582111698


More information about the Tutor mailing list