Skip to content

Instantly share code, notes, and snippets.

@caioerick
Created July 10, 2019 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caioerick/3f1941abba4efcf35b2eb37fa9103ea6 to your computer and use it in GitHub Desktop.
Save caioerick/3f1941abba4efcf35b2eb37fa9103ea6 to your computer and use it in GitHub Desktop.
import urllib.request
for i in range(1,2):
url_base = 'https://www.site.com/'
file = 'arquivo_{0:02d}.nc'.format(i)
url = url_base+file
print('Baixando {}...'.format(file))
# O arquivo será baixado e salvo na mesma pasta
if(urllib.request.urlretrieve(url, 'directory/'+file)):
print("Ok")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment