How can I load a module when I will only know the name 'on the fly'

Jeff Shannon jeffshannon at gmail.com
Tue Mar 15 02:17:13 CET 2005


Tobiah wrote:

> 
> 
> m = get_next_module()
> 
> some_nice_function_somehow_loads( m )

that'd be

   mymodule = __import__('modulename')


Jeff Shannon




More information about the Python-list mailing list