def download():
ftp = ftplib.FTP(SITE)<EOL>ftp.set_debuglevel(DEBUG)<EOL>ftp.login(USER, PASSWD)<EOL>ftp.cwd(DIR)<EOL>filelist = ftp.nlst()<EOL>filecounter = MANAGER.counter(total=len(filelist), desc='<STR_LIT>',<EOL>unit='<STR_LIT>')<EOL>for filename in filelist:<EOL><INDENT>with Writer(filename, ftp.size(filename), DEST) as writer:<EOL><INDENT>ftp.retrbinary('<STR_LIT>' % filename, writer.write)<EOL><DEDENT>print(filename)<EOL>filecounter.update()<EOL><DEDENT>ftp.close()<EOL>
Download all files from an FTP share