Created
June 28, 2016 15:55
-
-
Save dajuno/06de857fe880c4f4d71f8a08c54db294 to your computer and use it in GitHub Desktop.
print nested dict
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
# 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