I have a series of Class names and want to check them all and them import them. how to do this:
CName='Class_blahblah'
from eval(CName) import *
this is what I got:
SyntaxError: invalid syntax
To be exact: I have couple of classes I run in IDE in a FEA software and I do for each of them something like this:
if 'Class_SetSurfPart' in sys.modules:
del sys.modules['Class_SetSurfPart']
print 'old module Class_SetSurfPart deleted'
from Class_SetSurfPart import *
reload(sys.modules['Class_SetSurfPart'])
else:
from Class_SetSurfPart import *
but I want to put all class names in a List and do this as loop instead of doing this for all Classes.