FTP authentication with Python
from ftplib import FTP
import sys
 
username = "user_name"
password = "pass_word"
 
try:
	ftp = FTP('mywebsite.com')
	ftp.login(username, password)
	ftp.retrlines('LIST')
	ftp.quit()
 
except Exception, e:
    print "username or password is wrong or the server is unreachable"
    sys.exit(1)
%d bloggers like this: