1 # 输入模块名/函数
 2 url = input('请输入网址:')
 3 module,func = url.split('/')
 4 m = __import__('lib.'+module,fromlist=True)
 5 if hasattr(m,func):
 6     target = getattr(m,func)
 7     r = target()
 8     print(r)
 9 else:
10     print('404')

 

相关文章:

  • 2022-12-23
  • 2021-10-06
  • 2021-08-14
  • 2021-12-15
猜你喜欢
  • 2021-07-09
  • 2021-08-10
  • 2022-12-23
  • 2021-09-13
  • 2021-08-07
  • 2021-11-13
相关资源
相似解决方案