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:
this is a german Web-Mirror of PYTHON.ORG powered by Domainunion AG
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: