Skip to content

Instantly share code, notes, and snippets.

@jorotenev
Last active April 25, 2017 17:25
Show Gist options
  • Save jorotenev/3f6572660c4203d6a1cb4b66b7563ebc to your computer and use it in GitHub Desktop.
Save jorotenev/3f6572660c4203d6a1cb4b66b7563ebc to your computer and use it in GitHub Desktop.
def print_object_attrs(obj):
print("%s:" % obj.__name__)
for name, value in [(v, getattr(obj, v)) for v in obj.__dict__ if not v.startswith('__')]:
print("%s=%s" % (name, value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment