Skip to content

Instantly share code, notes, and snippets.

@UZziell
Created October 8, 2020 09:07
Show Gist options
  • Save UZziell/f88ef20480eb17f3be55cf86ff0c560e to your computer and use it in GitHub Desktop.
Save UZziell/f88ef20480eb17f3be55cf86ff0c560e to your computer and use it in GitHub Desktop.
Read compressed json file and write indented json to another file.
import json
import time
FILE_NAME = "Preferences"
with open(FILE_NAME, "r") as rfp:
data = json.load(rfp)
with open(FILE_NAME+"-indented.json", "w") as wfp:
wfp.write(json.dumps(data, indent=4, sort_keys=True))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment