import paramiko
transport = paramiko.Transport(('192.168.71.136', 22))
transport.connect(username='root', password='521521')
sftp = paramiko.SFTPClient.from_transport(transport)
# 将location.py 上传至服务器 /tmp/test.py
#sftp.put('.\\requirment.txt', '/tmp/test_from_win')
# 将remove_path 下载到本地 local_path
sftp.get('/root/oldgirl.txt', 'fromlinux.txt')transport.close()