Python 간단. ftp접속확인 코드

less than 1 minute read

#!/usr/bin/env python import ftplib server=”localhost” user=”anonymous” password=”test@hotmail.com” try: ftp = ftplib.FTP() ftp.connect(server,21) #specify port number when connection ftp.login(user,password) except Exception,e: print e else:
ftp.cwd(“incoming”)
ftp.retrlines(‘LIST’)