Created
October 19, 2018 14:00
-
-
Save alejio/9ef7975c8d594923e6da8d4f65c5c28e to your computer and use it in GitHub Desktop.
Pretty print long dict keys
This file contains 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
def dump_keys(d, lvl=0): | |
for k, v in d.items(): | |
print('%s%s' % (lvl * ' ', k)) | |
if type(v) == dict: | |
dump_keys(v, lvl+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment