Skip to content

Instantly share code, notes, and snippets.

@pintman
Created February 28, 2023 15:33
Show Gist options
  • Save pintman/6c74cbfafbe56985a79b9f8a6503e7dd to your computer and use it in GitHub Desktop.
Save pintman/6c74cbfafbe56985a79b9f8a6503e7dd to your computer and use it in GitHub Desktop.
import urllib.request
import datetime
def download(url):
"""
Download and return data from the given URL.
"""
data = urllib.request.urlopen(url).read()
return data
def save(data, filename):
'Save data into the given filename.'
with open(filename, 'wt') as f:
f.write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment