Last active
January 1, 2016 16:09
-
-
Save esebastian/8168930 to your computer and use it in GitHub Desktop.
Dump the state of a Python object
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
'from http://stackoverflow.com/a/192184/1663589 | |
def dump(obj): | |
for attr in dir(obj): | |
print "obj.%s = %s" % (attr, getattr(obj, attr)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment