【发布时间】:2021-09-28 23:27:49
【问题描述】:
是否可以在 Python 中使用用户输入调用模块和函数?
例如:
a = input("Module: ")
import a
b = input("Function: ")
a.b()
【问题讨论】:
-
这能回答你的问题吗? How to call Python functions dynamically
-
这能回答你的问题吗? import module from string variable
-
谢谢我解决了这个问题。您发布的链接有效。
标签: python python-3.x function import python-module