import modules at runtime

martin_valiente at my-deja.com martin_valiente at my-deja.com
Mon May 8 10:36:21 EDT 2000


Hi *

Is there a way to create an  object instance giving its classname at
runtime?

In java you can say:

...
Class c = Class.forName(stringWithTheNameOfTheClass);
Object o = c.newInstance():
...

Thanks in advance
M.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list