Skip to content

Instantly share code, notes, and snippets.

@ilyasProgrammer
Created September 2, 2016 04:36
Show Gist options
  • Save ilyasProgrammer/796a4142174c0a4286c0875274c84d67 to your computer and use it in GitHub Desktop.
Save ilyasProgrammer/796a4142174c0a4286c0875274c84d67 to your computer and use it in GitHub Desktop.
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