daily pastebin goal
84%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from ftplib import FTP
  2.  
  3. ftp = FTP('1bk2t.ddns.net')
  4. ftp.login(user='User', passwd = 'Password')
  5.  
  6. ftp.cwd('/path/')
  7.  
  8. filename = 'filename.txt'
  9.  
  10. ftp.retrbinary("RETR " + filename, open(filename, 'wb').write)
  11. ftp.quit()
  12.  
  13. var = localfile.read
  14.    
  15. contents = 0
  16. def collectLines(s):
  17.     global count
  18.     contents += s + "n"
  19.  
  20. ftp.retrlines("RETR " + filename, collectLines)
  21.    
  22. lines = []
  23. ftp.retrlines("RETR " + filename, lines.append)
RAW Paste Data
Top