python动态加载类和方法

1
2
3
4
5
6
7
def _importCls(self,model,action,params):
obj = __import__(model)
entrance = getattr(obj,action)
if params == '':
entrance()
else:
entrance(params)
ET碎碎念,每周一,晚六点一刻更新,欢迎订阅