假设def my_function():位于my_apps.views中,我想动态导入"my_function"而不使用像exec或eval这样的东西.
无论如何要做到这一点.我想做类似的事情:
my_function = import_func("my_apps.views.my_function")
my_function()...代码被执行
python import module function
function ×1
import ×1
module ×1
python ×1