欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python連接遠(yuǎn)程ftp服務(wù)器并列出目錄下文件的方法

 更新時間:2015年04月01日 10:47:16   作者:songguo  
這篇文章主要介紹了python連接遠(yuǎn)程ftp服務(wù)器并列出目錄下文件的方法,實(shí)例分析了Python使用pysftp模塊的技巧,非常具有實(shí)用價值,需要的朋友可以參考下

本文實(shí)例講述了python連接遠(yuǎn)程ftp服務(wù)器并列出目錄下文件的方法。分享給大家供大家參考。具體如下:

這段python代碼用到了pysftp模塊,使用sftp協(xié)議,對數(shù)據(jù)進(jìn)行加密傳輸

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程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論