Guest User

Untitled

a guest
Mar 4th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. from ftplib import FTP
  2. ftp = FTP()
  3.  
  4. host = 'localhost'
  5. port = 21 # Default is 21
  6. username = 'user'
  7. password = 'pass'
  8.  
  9. ftp.connect(host,port)
  10. ftp.login(username, password)
  11.  
  12. ftp.retrlines('LIST') # list directory contents
Add Comment
Please, Sign In to add comment