| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
pythopen
11年前发布

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