import importlib.util from config.config import INTERFACE inf = None def init(): global inf try: spec = importlib.util.spec_from_file_location("interface", INTERFACE) inf = importlib.util.module_from_spec(spec) spec.loader.exec_module(inf) except: raise ImportError(f"Cannot load interface module: {INTERFACE}")