1 inp=input(
'moudulus: ')
2 d=
__import__(inp)
3 inp_func=input(
'func name: ')
4 tfun=
getattr(inp,inp_func)
5 tfun()
hasattr(modulus,funcname)模块中有没有这个函数
setattr(modulus,funname,lambda )创建全局变量或者函数
delattr(modulus,funcname)删除
转载于:https://www.cnblogs.com/ezway/p/6609544.html