J
JoeSox
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)
but I need something like
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
because I will not know the plugin class names.sensorsList[0][0].do_foobar()