Based on the configuration file to load plug-ins

CMDB three parts: Manage, API, acquisition of assets

import importlib

a, b = v.rsplit ( '.', maxsplit = 1)

c=importlib.import_module(a)

cls=getattr(c,b)

Import py file, load the file folder .py

Import folder (package, module, library) = "init.py Load File folder

Guess you like

Origin www.cnblogs.com/jintian/p/11267342.html