Created
September 15, 2017 09:28
-
-
Save rgodishela/4a232796a1c49a101a6fd489119e9329 to your computer and use it in GitHub Desktop.
pp_json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def pp_json(json_thing, sort=True, indents=4): | |
if type(json_thing) is str: | |
print(json.dumps(json.loads(json_thing), sort_keys=sort, indent=indents)) | |
else: | |
print(json.dumps(json_thing, sort_keys=sort, indent=indents)) | |
return None | |
pp_json(your_json_string_or_dict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment