Importing different versions of a module

mercado mercado mercado949 at gmail.com
Tue Jul 22 13:05:47 EDT 2008


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...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080722/d4e14151/attachment.html>


More information about the Python-list mailing list