import paramiko
socks=('192.168.48.129',22)
testssh=paramiko.Transport(socks)
testssh.connect(username='username',password='password')
sftptest=paramiko.SFTPClient.from_transport(testssh)
remotepath="/home/zhoudan/test.log"
localpath="D:\\test\\test.log"
sftptest.put(localpath,remotepath)
sftptest.close()
testssh.close()