How to instatiate a class of which the name is only known at runtime?

Erik Max Francis max at alcyone.com
Tue Sep 9 16:55:26 EDT 2003


John Roth wrote:

> As Nick said, you can use the exec statement. You can
> also use the _import() function.

>>> _import
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name '_import' is not defined

Do you mean __import__?

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ But when I reached the finished line / Young black male
\__/  Ice Cube




More information about the Python-list mailing list