diff --git a/parserJson.py b/parserJson.py new file mode 100644 index 0000000..34ee7bb --- /dev/null +++ b/parserJson.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 parserJson.py") + print("or") + print("cat ... | python3 parserJson.py") \ No newline at end of file