import modules at runtime

Alex cut_me_out at hotmail.com
Mon May 8 10:59:39 EDT 2000


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

This sort of thing works:

>>> class C: pass
... 
>>> c = eval ('C') ()
>>> c
<__main__.C instance at 103e18>
>>> 

Alex.



More information about the Python-list mailing list