python通过ftp发送文件,,import ftpli


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

评论关闭