Skip to content

Instantly share code, notes, and snippets.

@alejio
Created October 19, 2018 14:00
Show Gist options
  • Save alejio/9ef7975c8d594923e6da8d4f65c5c28e to your computer and use it in GitHub Desktop.
Save alejio/9ef7975c8d594923e6da8d4f65c5c28e to your computer and use it in GitHub Desktop.
Pretty print long dict keys
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