Skip to content

Instantly share code, notes, and snippets.

@ajayguru2
Created February 17, 2018 20:38
Show Gist options
  • Save ajayguru2/16092b9359da57aad6275fc087e563ab to your computer and use it in GitHub Desktop.
Save ajayguru2/16092b9359da57aad6275fc087e563ab to your computer and use it in GitHub Desktop.
For downloading the solutions to the famous CLRS quickly and without any hassle. Save your time and willpower
# http://sites.math.rutgers.edu/~ajl213/CLRS/Ch1.pdf
import requests
count = int(input("Enter the Chapter number"))
try:
url = "http://sites.math.rutgers.edu/~ajl213/CLRS/Ch"+ str(count) + ".pdf"
r = requests.get(url, allow_redirects=True)
open('CLRS:' + 'chapter' + str(count), 'wb').write(r.content)
print("file successfully saved!!")
except Exception as e:
print("Network Error")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment