Skip to content

Instantly share code, notes, and snippets.

@victory-sokolov
Last active February 23, 2020 14:05
Show Gist options
  • Save victory-sokolov/f225c80ac756c3686cc6b2c79d628789 to your computer and use it in GitHub Desktop.
Save victory-sokolov/f225c80ac756c3686cc6b2c79d628789 to your computer and use it in GitHub Desktop.
Get list of methods from class
# 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