Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. from ftplib import FTP
  2. from os import remove
  3.  
  4. host = ""
  5. port = 25
  6. username = ""
  7. password = ""
  8. name_file = "command.txt"
  9.  
  10. ftp = FTP(host)
  11. ftp.login(username, password)
  12.  
  13. with open(name_file, w) as f:
  14.     f.write("start")
  15.  
  16. ftp.delete(name_file)
  17. file = open(name_file,'rb')
  18. ftp.storbinary('STOR command.txt', file)
  19. file.close()
  20. remove(name_file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement