python - how to call function in paramiko -


for transfer entire folder server using sftp paramiko. copy code stackoverflow

but doubt how call function, put ..

sftp = paramiko.sftpclient.from_transport(t) m = mysftpclient() m.put_dir() m.mkdir() 

but throwing error:

*** caught exception: <type 'exceptions.typeerror'>: __init__() takes 2 arguments (1 given) 

the error message indicates function calling takes 2 arguments while sending zero. try doing instead:

t = paramiko.transport(("ftpexample.com", 22)) t.connect(username = myusername, password = mypassword)  sftp = paramiko.sftpclient.from_transport(t) 

use sftp client upload file @ localpath (e.g. /usr/tmp/test.png") remote path:

sftp.put("localpath","remotepath") 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -