Skip to content

Instantly share code, notes, and snippets.

@madsc13ntist
Created May 8, 2018 15:06
Show Gist options
  • Select an option

  • Save madsc13ntist/8389815e82523e0afd85e3f0b7e45db4 to your computer and use it in GitHub Desktop.

Select an option

Save madsc13ntist/8389815e82523e0afd85e3f0b7e45db4 to your computer and use it in GitHub Desktop.
A simple function that prints a representation of any object. Just feed it a variable and enjoy an exploded view.
from pprint import pprint
def explode(obj):
"""
explode(obj)
List contents of 'obj'
:param obj: an object to explore.
:return:
"""
try:
pprint(vars(obj), indent=2)
except TypeError:
pprint(dir(obj), indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment