Last active
May 31, 2018 12:56
-
-
Save clamytoe/fc3f8e1549b7b461b89a50e04a355355 to your computer and use it in GitHub Desktop.
tools.py
This file contains hidden or 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 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