Created
August 24, 2016 13:19
-
-
Save mirekfranc/d700987c5e6b5e733fe224c5299e1134 to your computer and use it in GitHub Desktop.
Read JSON from zip archive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import zipfile | |
archive = 'something.zip' | |
with zipfile.ZipFile(archive, 'r') as myzip: | |
for zi in myzip.infolist(): | |
if zi.filename.endswith('.json'): | |
with myzip.open(zi, 'rU') as f: | |
for line in f: | |
print(line, end='') | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment