Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # put script in ~/Library/Application Support/TextWrangler/Text Filters/Format JSON.py
- #!/usr/bin/python
- import fileinput
- import json
- if __name__ == "__main__":
- text = ''
- for line in fileinput.input():
- text = text + ' ' + line.strip()
- jsonObj = json.loads(text)
- print json.dumps(jsonObj, sort_keys=True, indent=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement