python链接远程ftp服务器并列出目录下的文件

2015-05-14 0 1,008
python链接远程ftp服务器并列出目录下的文件

python链接远程ftp服务器并列出目录下的文件,这段python代码用到了pysftp模块,使用sftp协议,对数据进行加密传输

import pysftp
  
srv = pysftp.Connection(host="your_FTP_server", username="your_username",
password="your_password")
  
# Get the directory and file listing
data = srv.listdir()
  
# Closes the connection
srv.close()
  
# Prints out the directories and files, line by line
for i in data:
    print i

遇见资源网 python python链接远程ftp服务器并列出目录下的文件 http://www.ox520.com/15322.html

常见问题

相关文章

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

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