I am importing 3rd party modules via a plugin script. I wish to iterate thru the modules and call a common method like .do_foobar() or something with all the imports. But I can't figure out how to do something like below without knowing the class name before hand. Is there a builtin that helps call classes anonymously?
(Calling example.do_foobar() works because I manually enter the classes' name) >>> a=MyApp() >>> sensorsList = [] >>> for snames in a.pluginsDict["sensorsplugins"]: sensorsList.append(__import__(snames)) >>> sensorsList[0].example.do_foobar() but I need something like >>> sensorsList[0][0].do_foobar() because I will not know the plugin class names. -- Later, Joe -- http://mail.python.org/mailman/listinfo/python-list