Created
May 14, 2018 19:12
-
-
Save maltzsama/9e19ba0a7e5584b838b8070e95e2fa95 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
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