Created
April 10, 2017 11:53
-
-
Save schbrongx/5f76f7ce5dcf6ecfe2a4fed717827e80 to your computer and use it in GitHub Desktop.
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 print_nested(_obj, _iterator=0): | |
''' iterate through an iterable object | |
- print_nested if parameter is another iterable object | |
- print value if parameter is not iterable | |
DEPENDENCY: is_iterable.py: https://gist.github.com/schbrongx/ad66fdd50d72b0042cd26c2689b0c10f | |
''' | |
for param in _obj: | |
if is_iterable(_obj[param]): | |
log.debug(' ' * _iterator + param + ': ') | |
print_nested(_obj[param], _iterator+1) | |
else: | |
log.debug(' ' * _iterator + param + ' = ' + str(_obj[param])) | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment