Skip to content

Instantly share code, notes, and snippets.

@davidecavaliere
Created May 9, 2014 15:16
Show Gist options
  • Save davidecavaliere/16b45bd596fe4b2aac68 to your computer and use it in GitHub Desktop.
Save davidecavaliere/16b45bd596fe4b2aac68 to your computer and use it in GitHub Desktop.
Json Formatter for Gedit
#! /usr/bin/env python
import json
import sys
j = json.load(sys.stdin)
print json.dumps(j, sort_keys=True, indent=2)
@ddittmar
Copy link

with python3:

#!/usr/bin/env python3

import json
import sys

j = json.load(sys.stdin)
print(json.dumps(j, sort_keys=False, indent=4))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment