From fad877b279618b2f74ffccc0fe610d54748d60f9 Mon Sep 17 00:00:00 2001 From: ronan Date: Wed, 29 Jun 2016 16:34:29 +0200 Subject: [PATCH] added new file --- parserJson.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 parserJson.py 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 -- 1.7.9.5