You can load a module dynamically like so:
1 __import__("os")
If you do that, though, "os" isn't bound to anything.
Once you have the module, you probably want to find classes and functions and data inside of it.
Use getattr:
You can load a module dynamically like so:
1 __import__("os")
If you do that, though, "os" isn't bound to anything.
Once you have the module, you probably want to find classes and functions and data inside of it.
Use getattr:
LoadingModulesDynamically (last edited 2008-11-15 14:00:47 by localhost)
Unable to edit the page? See the FrontPage for instructions.