Skip to content

Instantly share code, notes, and snippets.

@maltzsama
Created May 14, 2018 19:12
Show Gist options
  • Save maltzsama/9e19ba0a7e5584b838b8070e95e2fa95 to your computer and use it in GitHub Desktop.
Save maltzsama/9e19ba0a7e5584b838b8070e95e2fa95 to your computer and use it in GitHub Desktop.
import json
def json_decode(info = None, table = None):
print '\n\n'
print '==============================='
print table
keys = info.keys()
for k in keys:
if type(info[k]) == dict:
json_decode(info[k], k)
elif type(info[k]) == list:
for el in info[k]:
json_decode(el, k)
else:
print info[k], k
print '==============================='
print '\n\n'
with open('arquivo.json') as f:
data = json.load(f)
for n in data:
json_decode(n, 'main')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment