I have installed wget on my Python, and I'm downloading files from different URLs with it. So far my code looks like this:
import wget
urls = ['https://www.iedb.org/downloader.php?file_name=doc/epitope_full_v3.zip',
'https://www.iedb.org/downloader.php?file_name=doc/tcell_full_v3.zip',
'https://www.iedb.org/downloader.php?file_name=doc/bcell_full_v3.zip',
'https://www.iedb.org/downloader.php?file_name=doc/mhc_ligand_full_single_file.zip']
path = '/home/david/data/files/zip_files'
for url in urls:
wget.download(url, path)
I want my code to overwrite the downloaded files if they exist, so that way every time I run the code I get the latest version of that files, instead of keeping the old ones and downloading the new ones with a different name (e.g, if epitope_full_v3.zip already exists, when I execute the code it will download it again, but will keep the old one and rename the new one to epitope_full_v3_1.zip).
I know that wget can take an -O argument in the shell that allows you to do that, but I have not seen that for the python version on the documentation. I appreciate your help.