dynamic module import?

Chris Rebert clp2 at rebertia.com
Sat Jan 17 00:25:38 CET 2009


On Fri, Jan 16, 2009 at 3:03 PM, Lawson Hanson
<lawsonhanson at optusnet.com.au> wrote:
> Is it possible to import a module of Python code
>    where I do not know the name of the module
>    until run-time?

Yes. Use the __import__() built-in function. See
http://docs.python.org/library/functions.html#__import__ for details.

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com



More information about the Python-list mailing list