I have a python class called CreateDB, with a method execute(module_name). The module_name variable is a string and tells me which class by that name should be called. CreateDB does not know and does not care where class Car is defined, it only knows that it's not defined in the same file as he is. I know what class to call and what function, but don't know how to access the class.
For example:
#in folder helpers class CreateDB(): def execute(module_name): #call the method from the class with that module_name global_dict[module_name].run_sql_create()
#in different folder classes
class Car():
@staticmethod
def run_sql_create():
#do work
c = CreateDB()
c.execute("Car")
The question is, how to do this, using signals? or to cache all classes into a global dictionary and access it that way?