Skip to content

Instantly share code, notes, and snippets.

@dajuno
Created June 28, 2016 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dajuno/06de857fe880c4f4d71f8a08c54db294 to your computer and use it in GitHub Desktop.
Save dajuno/06de857fe880c4f4d71f8a08c54db294 to your computer and use it in GitHub Desktop.
print nested dict
# var 1
for key, val in prms.items():
if type(val) is dict:
for key2, val2 in val.items():
print('\t {0}: {1}'.format(key2, val2))
else:
print('{0}: {1}'.format(key, val))
# var 2
import yaml
print(yaml.dump(prms))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment