Skip to content

Instantly share code, notes, and snippets.

@ivanromanko
Last active October 20, 2015 15:36
Show Gist options
  • Save ivanromanko/d56d30f4fd4f01e3d509 to your computer and use it in GitHub Desktop.
Save ivanromanko/d56d30f4fd4f01e3d509 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import fileinput
import json
from pprint import pprint
for line in fileinput.input():
if not line.startswith(("{", "[")):
print(line.strip())
else:
#pprint(json.loads(line))
print(json.dumps(json.loads(line), indent=4, separators=(',', ': ')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment