Created
August 29, 2016 18:45
-
-
Save michaelconnor00/8b9babefa05292827aba46c07e4ad955 to your computer and use it in GitHub Desktop.
Python Inspect
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
# Inspect the modules in the package and loop through them. | |
members = inspect.getmembers(sys.modules[package_name], inspect.ismodule) | |
for name, data in members: | |
if name == 'models.py': | |
data.MyClass.run_function() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment