Skip to content

Instantly share code, notes, and snippets.

View grofte's full-sized avatar

Morten Grøftehauge grofte

View GitHub Profile
@mberz
mberz / urllib3_download.py
Created December 7, 2020 20:39
Download a file using urllib3
import urllib3
import shutil
http = urllib3.PoolManager()
with open(filename, 'wb') as out:
r = http.request('GET', url, preload_content=False)
shutil.copyfileobj(r, out)