Last active
February 23, 2020 14:05
-
-
Save victory-sokolov/f225c80ac756c3686cc6b2c79d628789 to your computer and use it in GitHub Desktop.
Get list of methods from class
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
# Returns list of methods of class: PersonClass | |
method_list = [func for func in dir(PersonClass) if callable(getattr(PersonClass, func)) and not func.startswith("__")] | |
# Execute methods | |
for method in method_list: | |
execute = getattr(class_name, method) | |
execute() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment