Created
March 17, 2015 02:12
-
-
Save mpurdon/278467c510fb7447b30c to your computer and use it in GitHub Desktop.
dynamic import
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 importlib | |
mod = importlib.import_module('dir.mymodule') | |
MyClass = getattr(mod, 'MyClass') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment