Skip to content

Instantly share code, notes, and snippets.

@michaelconnor00
Created August 29, 2016 18:45
Show Gist options
  • Save michaelconnor00/8b9babefa05292827aba46c07e4ad955 to your computer and use it in GitHub Desktop.
Save michaelconnor00/8b9babefa05292827aba46c07e4ad955 to your computer and use it in GitHub Desktop.
Python Inspect
# 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