I am trying to make this script to automate some of my daily FTP downloading at work. I am not programmer but I been practicing Python for a while now. Currently I can download single files but cant figure out how to download whole directory.
For testing purposes I have been trying to downloading
ftp.debian.org/debian/doc dir
Could someone point me to the right direction?
My current code is:
For testing purposes I have been trying to downloading
ftp.debian.org/debian/doc dir
Could someone point me to the right direction?
My current code is:
#FTP import ftplib import wget site_address = input('please enter FTP address: ') with ftplib.FTP(site_address) as ftp: ftp.login() print(ftp.getwelcome()) print('Current directory', ftp.pwd()) ftp.dir() next_dir = input('Where do you want to go next? ') ftp.cwd(next_dir) print('Current directory', ftp.pwd()) ftp.dir() download = input('what file would you like to download? ') ftp.retrbinary('RETR ' + download, open(download, 'wb').write) print('File download succesful') ftp.quit() print('goodbye')