IT虾米网

python从ftp服务器下载文件

shasha 2018年06月24日 编程语言 1235 0
import ftplib 
ftp = ftblib.FTP("ftp.yourServer.com") 
ftp.login("username", "password") 
filename = "index.html" 
ftp.storlines("STOR " + filename, open(filename)) 
filename="app.exe" 
ftp.storbinary("STOR " + filename, open(filename, "rb"), 1024)

评论关闭
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!