Skip to content

Instantly share code, notes, and snippets.

View 1pha's full-sized avatar
💦
I may be slow to respond.

Daehyun Cho 1pha

💦
I may be slow to respond.
View GitHub Profile
@hantoine
hantoine / download_and_unzip.py
Last active November 22, 2023 06:25
Download and extract a ZIP file in Python
from urllib.request import urlopen
from io import BytesIO
from zipfile import ZipFile
def download_and_unzip(url, extract_to='.'):
http_response = urlopen(url)
zipfile = ZipFile(BytesIO(http_response.read()))
zipfile.extractall(path=extract_to)