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

2015-05-14 0 124
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()

遇见资源网 python python通过pysftp加密上传、下载ftp服务器文件 http://www.ox520.com/15323.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务