Skip to content

Instantly share code, notes, and snippets.

@tkoz0
Created March 29, 2021 11:05
Show Gist options
  • Save tkoz0/257e7d1875d4860ed79d5c384457ce42 to your computer and use it in GitHub Desktop.
Save tkoz0/257e7d1875d4860ed79d5c384457ce42 to your computer and use it in GitHub Desktop.
Something I wrote a long time ago for downloading problem PDFs from uva.onlinejudge.org
import os
url_base = 'https://uva.onlinejudge.org/external/'
volumes = list(range(1,1+17)) + list(range(100,1+133))
for volume in volumes:
os.system('mkdir %d'%volume)
os.chdir('%d'%volume)
for problem in range(100):
url = url_base + '%d/%d%02d.pdf'%(volume,volume,problem)
os.system('wget "%s"'%url)
os.chdir('..')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment