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

Jeff Shannon jeffshannon at gmail.com
Mon Mar 14 20:17:13 EST 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