python通过pysftp加密上传、下载ftp服务器文件详解编程语言

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

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

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/8383.html

(0)
上一篇 2021年7月18日 19:33
下一篇 2021年7月18日 19:33

相关推荐

发表回复

登录后才能评论