Possible Duplicate:
Dynamic module import in Python
I have a list of modules, like so:
modules = ['ModuleA', 'ModuleB', 'ModuleC']
Each .py for the module resides in a subdirectory that I’ve added to the include paths. What I’m looking for is a way to load the modules and build a list of references to said loaded modules.
This should answer your question:
or if you prefer dictionary with modules’ names as keys:
Does it answer your question?