1import paramiko
2import os
3
4paramiko.util.log_to_file('logfile.log')
5
6host = "101.102.103.104"
7port = 22
8transport = paramiko.Transport((host, port))
9password = "pass"
10username = "user"
11
12sftp = paramiko.SFTPClient.from_transport(transport)
13
14filepath = '~/remote/file'
15localpath = '~/local/file'
16sftp.get(filepath, localpath)
17
18sftp.close()
19transport.close()
20