Skip to content

Instantly share code, notes, and snippets.

@studiawan
Created October 19, 2015 22:21
Show Gist options
  • Save studiawan/779596d3629f64a8e6ee to your computer and use it in GitHub Desktop.
Save studiawan/779596d3629f64a8e6ee to your computer and use it in GitHub Desktop.
Using ftplib to print current working directory
from ftplib import FTP
f = FTP('localhost')
print "Welcome:", f.getwelcome()
f.login('hudan')
print "Current working directory:", f.pwd()
names = f.nlst()
print 'List of directory: ', names
f.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment