Skip to content

Instantly share code, notes, and snippets.

@sidja
Created March 16, 2017 05:48
Show Gist options
  • Save sidja/aaa3b4081b905b09930e80462c841bdc to your computer and use it in GitHub Desktop.
Save sidja/aaa3b4081b905b09930e80462c841bdc to your computer and use it in GitHub Desktop.
pretty print your dictionary values
def pretty(d, indent=0):
for key, value in d.iteritems():
print '\t' * indent + str(key)
if isinstance(value, dict):
pretty(value, indent+1)
else:
print '\t' * (indent+1) + str(value)
pretty(a, indent=3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment