Python 字典,可以直接存放函数,并执行正常。#!/usr/bin/python3 dict1 = dict() def test_fun(): print("test dict") dict1["func"] = test_fun dict1["func"]()