-
-
Save rameshshihora/e1a38906a3a13f9c85aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env python | |
| import json | |
| import sys | |
| def pp(vv, prefix='$'): | |
| if isinstance(vv, (list,tuple)): | |
| for i, v in enumerate(vv): | |
| pp(v, "{0}[{1}]".format(prefix, i)) | |
| elif isinstance(vv, dict): | |
| for k,v in sorted(vv.items()): | |
| pp(v, "{0}.{1}".format(prefix, k)) | |
| else: | |
| print '{0} = {1}'.format(prefix, json.dumps(vv)) | |
| pp(json.load(sys.stdin)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment