step-01-download-rfc.py 375 B

12345678910111213141516
  1. # Step 01 - download RFC7932.
  2. #
  3. # RFC is the ultimate source for brotli format and constants, including
  4. # static dictionary.
  5. import urllib2
  6. response = urllib2.urlopen("https://tools.ietf.org/rfc/rfc7932.txt")
  7. text = response.read()
  8. path = "rfc7932.txt"
  9. with open(path, "w") as rfc:
  10. rfc.write(text)
  11. print("Downloaded and saved " + str(len(text)) + " bytes to " + path)