Hello,
I would like to import a module using a "read in" variable.
eg, something along the lines of:
----------------------------------------------------------
variable = raw_input("Module name is: ") # type in MYMOD
import variable
----------------------------------------------------------
The import command however doesn't expand "variable" to "MYMOD".
ie, ImportError: no module named variable
Does anyone know any way round this ?
I would like to import a module using a "read in" variable.
eg, something along the lines of:
----------------------------------------------------------
variable = raw_input("Module name is: ") # type in MYMOD
import variable
----------------------------------------------------------
The import command however doesn't expand "variable" to "MYMOD".
ie, ImportError: no module named variable
Does anyone know any way round this ?