Created
November 13, 2020 19:19
-
-
Save jes/1f0c4b9dd07729aad7da6da4f4320360 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
import gzip, os, sys | |
infile = open("fresh-food-16.json", "r") | |
b = bytes(infile.read(),"utf8") | |
n = 0 | |
while True: | |
n += 1 | |
if n % 1000 == 0: | |
print(str(n)) | |
with gzip.open("foo.gz", "wb") as f: | |
f.write(b) | |
os.unlink("foo") | |
if os.system("gunzip -k foo.gz") != 0: | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment