newbie question: how to get the class instance given a module object?

Tian wangtianthu at
Mon Mar 28 07:56:54 CEST 2005

I have a module called, in which there is a class called
Dog, what should I put in the "????" part to get the instance of class

import ModuleA

classname = "Dog"
module = globals()["ModuleA"]
classobj = ???????           <---using classname
instanct = classobj()

More information about the Python-list mailing list