Guest User

Untitled

a guest
May 2nd, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import requests
  2. import io
  3. import zipfile
  4. def download_extract_zip(url):
  5.  
  6. response = requests.get(url)
  7. with zipfile.ZipFile(io.BytesIO(response.content)) as thezip:
  8. for zipinfo in thezip.infolist():
  9. with thezip.open(zipinfo) as thefile:
  10. yield zipinfo.filename, thefile
Advertisement
Add Comment
Please, Sign In to add comment