Created
June 14, 2020 22:08
-
-
Save hackingbutlegal/ab8f8b07180583aeb9360ae5cf711fdf to your computer and use it in GitHub Desktop.
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
import YOUR_LIBRARY_HERE | |
def get_methods(object, spacing=20): | |
methodList = [] | |
for method_name in dir(object): | |
try: | |
if callable(getattr(object, method_name)): | |
methodList.append(str(method_name)) | |
except: | |
methodList.append(str(method_name)) | |
processFunc = (lambda s: ' '.join(s.split())) or (lambda s: s) | |
for method in methodList: | |
try: | |
print(str(method.ljust(spacing)) + ' ' + | |
processFunc(str(getattr(object, method).__doc__)[0:90])) | |
except: | |
print(method.ljust(spacing) + ' ' + ' getattr() failed') | |
get_methods(YOUR_OBJECT_HERE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment