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

2005-03-15 Thread gene . tani
imp.find_module() and imp.load_module: http://www.python.org/doc/2.3.4/whatsnew/section-pep302.html http://docs.python.org/lib/module-imp.html renwei wrote: > use built-in function: __import__ > > m = __import__('sys', globals()) > print m.platform > > weir > > > > "Tobiah" <[EMAIL PROTECTED]> >

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

2005-03-14 Thread renwei
use built-in function: __import__ m = __import__('sys', globals()) print m.platform weir "Tobiah" <[EMAIL PROTECTED]> > > > m = get_next_module() > > some_nice_function_somehow_loads( m ) > > Thanks, > > Tobiah -- http://mail.python.org/mailman/listinfo/python-list

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

2005-03-14 Thread Jeff Shannon
Tobiah wrote: m = get_next_module() some_nice_function_somehow_loads( m ) that'd be mymodule = __import__('modulename') Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

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

2005-03-14 Thread Tobiah
m = get_next_module() some_nice_function_somehow_loads( m ) Thanks, Tobiah -- http://mail.python.org/mailman/listinfo/python-list