Python/Python Programming

[Python] FTP TLS Download 다운로드

Pydole 2018. 8. 7. 01:44

 

DOCS : https://docs.python.org/3.6/library/ftplib.html?highlight=ftp_tls

from ftplib import FTP_TLS

ftps = FTP_TLS('host')
ftps.login('host', 'passwd')
ftps.prot_p()
filename = 'test1.txt'
myfile = open(filename, 'wb')
ftps.retrbinary('RETR %s' % filename, myfile.write)
ftps.close()