Python 动态初始化类,调用方法
modmeta = __import__(classname)
c = getattr(modmeta, classname)
obj = c() # new class
print(obj)
meth = getattr(obj, "setDriver")
print(meth)
#方法使用可传参数
meth(driver)
modmeta = __import__(classname)
c = getattr(modmeta, classname)
obj = c() # new class
print(obj)
meth = getattr(obj, "setDriver")
print(meth)
#方法使用可传参数
meth(driver)