勾魂幼兽,书楼网,刘雨欣爆乳
# _*_ coding:utf-8 _*_
# name gefile.py
import os
import stat
import socket
import paramiko
files=["filenamea","filenameb","filenamec","filenamed","filenamee"]
username="root"
password="123456"
host="192.168.1.66"
port=22
remotefile="/root/filename"
localpath=r'd:\docs\filename_download'
sock = socket.socket(socket.af_inet, socket.sock_stream)
sock.connect((host,port))
t = paramiko.transport(sock)
t.start_client()
t.auth_password(username,password)
sftptest=paramiko.sftpclient.from_transport(t)
sftptest.get(remotefile,localpath)
sftptest.close()
t.close()
sock.close()
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
-
python中def是做什么的
python使用def开始函数定义,紧接着是函数名,括号内部为函数的参数,内部为函数的 具体功能实现代码,如果想要函数有返回值, 在expressions中的逻...
[阅读全文]
-
-
-
-
-
-
网友评论