Guest User

Untitled

a guest
Oct 30th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import ftplib
  2. host = "*"
  3. ftp_user = "*"
  4. ftp_password = "*"
  5. filename = "picture.png"
  6. con = ftplib.FTP(host, ftp_user, ftp_password)
  7. lf = open(filename, "wb")
  8. con.retrbinary("RETR " + filename, lf.write)
  9. lf.close()
  10.  
  11. import os
  12.  
  13. with ftplib.FTP(host, *credentials) as ftp,
  14. open(os.path.join("директория", filename), "wb") as file:
  15. ftp.retrbinary("RETR " + filename, file.write)
Add Comment
Please, Sign In to add comment