Skip to content

Instantly share code, notes, and snippets.

@clamytoe
Last active May 31, 2018 12:56
Show Gist options
  • Save clamytoe/fc3f8e1549b7b461b89a50e04a355355 to your computer and use it in GitHub Desktop.
Save clamytoe/fc3f8e1549b7b461b89a50e04a355355 to your computer and use it in GitHub Desktop.
tools.py
from re import sub
def explore(object):
"""Lists all methods and properties for the given object"""
_class = str(object.__class__).split()[1]
_class = sub('>', '', _class)
print(f'\nExplore -> {_class}\n')
for inner in dir(object):
if '_' not in inner:
desc = eval(f'object.{inner}.__doc__')
_type = type(eval(f'object.{inner}'))
print(f'{inner}: {_type}')
if desc:
desc = desc.strip()
desc = sub(' ', '', desc)
desc = sub('\n', ' ', desc)
print(f' {desc}\n')
else:
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment