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

renwei renwei at koal.com
Tue Mar 15 00:22:40 EST 2005


use built-in function:  __import__

m = __import__('sys', globals())
print m.platform

weir



"Tobiah" <toby at rcsreg.com> >
>
> m = get_next_module()
>
> some_nice_function_somehow_loads( m )
>
> Thanks,
>
> Tobiah





More information about the Python-list mailing list