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)删除

相关文章:

  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-04-07
  • 2022-12-23
猜你喜欢
  • 2021-09-10
  • 2022-02-19
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
相关资源
相似解决方案