Question on dynamically loaded modules.

Adonis adonisv at
Mon Mar 24 01:10:42 CET 2003

What is the best way to instantiate a module's class and it's members given
that the module(s) can be loaded at any given time?

i.e. (pseudo code)

for module in module_list:
    import module
    ...then how to obtain its classes and initialize them

I understand I need to use the dir() function (or a better way?), but what
would be the most effective avenue to do this?

Any help is greatly appreciated.


More information about the Python-list mailing list