python通过pysftp加密上传、下载ftp服务器文件,pythonpysftp,python通过pysf


python通过pysftp加密上传、下载ftp服务器文件

import pysftpimport sys# Defines the name of the file for download / uploadremote_file = sys.argv[1]srv = pysftp.Connection(host="your_FTP_server", username="your_username",password="your_password")# Download the file from the remote serversrv.get(remote_file)# To upload the file, simple replace get with put.srv.put(remote_file)# Closes the connectionsrv.close()

评论关闭