from spam import eggs, spam at runtime, how?

Paul Rubin http
Tue Dec 9 15:56:56 EST 2003


Rene Pijlman <reply.in.the.newsgroup at my.address.is.invalid> writes:
> >Why not just stick the import statement where you need it?
> 
> Because I need a module from one of a number of different packages, at one
> specific point in my code.

I still don't understand why you don't want to use an exec statement
for this.  That's by far the most natural and understandable way to do it.




More information about the Python-list mailing list