diff --git a/prettyJson.py b/prettyJson.py new file mode 100644 index 0000000..24fc3e2 --- /dev/null +++ b/prettyJson.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +import json, sys +from pprint import pprint + +if not sys.stdin.isatty(): + JSON = json.loads(sys.stdin.read()) + pprint(JSON) +else: + print("Use this script with a pipe command.") + print("") + print("echo '...' | python3 prettyJson.py") + print("or") + print("cat ... | python3 prettyJson.py") \ No newline at end of file