[Python] python通过ftp发送文件 →→→→→进入此内容的聊天室

来自 , 2021-03-03, 写在 Python, 查看 149 次.
URL http://www.code666.cn/view/aac93371
  1. import ftplib                                          # We import the FTP module
  2. session = ftplib.FTP('myserver.com','login','passord') # Connect to the FTP server
  3. myfile = open('toto.txt','rb')                         # Open the file to send
  4. session.storbinary('STOR toto.txt', myfile)            # Send the file
  5. myfile.close()                                         # Close the file
  6. session.quit()                                         # Close FTP session
  7. #//python/201

回复 "python通过ftp发送文件"

这儿你可以回复上面这条便签

captcha