Skip to content

Instantly share code, notes, and snippets.

@linuxkidd
Last active August 7, 2019 20:25
Show Gist options
  • Select an option

  • Save linuxkidd/756b927ed4063ef1d60cc0428f77a7b7 to your computer and use it in GitHub Desktop.

Select an option

Save linuxkidd/756b927ed4063ef1d60cc0428f77a7b7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import json
obj=json.load(sys.stdin)
if ( len(sys.argv) > 0 ):
for i in range(1,len(sys.argv)):
levels=sys.argv[i].split('.')
for j in range(0,len(levels)):
if ( j == 0 ):
newobj=obj
if (levels[j]!=""):
newobj=newobj[levels[j]]
print newobj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment