Created
September 2, 2016 04:36
-
-
Save ilyasProgrammer/796a4142174c0a4286c0875274c84d67 to your computer and use it in GitHub Desktop.
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
def dump(obj): | |
for attr in dir(obj): | |
print "obj.%s = %s" % (attr, getattr(obj, attr)) | |
def dumpclean(obj): | |
if type(obj) == dict: | |
for k, v in obj.items(): | |
if hasattr(v, '__iter__'): | |
print k | |
dumpclean(v) | |
else: | |
print '%s : %s' % (k, v) | |
elif type(obj) == list: | |
for v in obj: | |
if hasattr(v, '__iter__'): | |
dumpclean(v) | |
else: | |
print v | |
else: | |
print obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment