python通过ftp上传文件

2015-01-17 0 339
python通过ftp上传文件

引入ftplib模块通过ftp发送文件的方法

import ftplib                                          # We import the FTP module
session = ftplib.FTP('myserver.com','login','passord') # Connect to the FTP server
myfile = open('toto.txt','rb')                         # Open the file to send
session.storbinary('STOR toto.txt', myfile)            # Send the file
myfile.close()                                         # Close the file
session.quit()                                         # Close FTP session

遇见资源网 python python通过ftp上传文件 http://www.ox520.com/15043.html

常见问题

相关文章

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

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