priore

JSON formatter for TextWrangler

Jan 16th, 2014
193
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # put script in ~/Library/Application Support/TextWrangler/Text Filters/Format JSON.py
  2. #!/usr/bin/python
  3. import fileinput
  4. import json
  5. if __name__ == "__main__":
  6.   text = ''
  7.   for line in fileinput.input():
  8.     text = text + ' ' + line.strip()
  9.   jsonObj = json.loads(text)
  10.   print json.dumps(jsonObj, sort_keys=True, indent=2)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×