Importing different versions of a module
Fredrik Lundh
fredrik at pythonware.com
Tue Jul 22 13:21:00 EDT 2008
mercado mercado wrote:
> It seems that you can specify the name of the module to be imported at
> runtime using the following syntax:
>
> X = __import__('X')
>
> (from http://effbot.org/zone/import-confusion.htm)
>
> Of course, I would rather specify the path to the module at runtime, not
> the module name itself, but at least this is a start...
additional approaches can be found here:
http://effbot.org/zone/import-string.htm
also see my other reply to you in this thread.
</F>
More information about the Python-list
mailing list