September 3rd, 2004, 02:21 AM
dynamic module loading
I m quite new to python.and i m having following problem.
I read an xml file from my python module
the names in the file are actually module names that i have to load.
Each module has a class which is basically extened from Thread class.
I did see the __import__ example in the python doc(for loading a module),but i m unsure abt How to Instantiate and use the class in that module.
please any idea?
September 3rd, 2004, 04:44 AM
It does not matter what the modules do.
Importing using the __import__ function is very simple, here are three ways to import all achieving the same thing:
#import the time module
#import the time module with a different name
import time as aTime
#import the time module using a string
bTime = __import__("time")
September 6th, 2004, 05:57 AM
Thanx Grim Archon