python 使用函数名的字符串调用函数(4种方法)_black-heart的专栏-CSDN博客 https://blog.csdn.net/mrqingyu/article/details/84403924

funcs = ['fetch_data_' + i for i in (
'activities', 'banners', 'server_list')]
# from operator import methodcaller
# f=lambda fn:methodcaller(fn)(self)
f = lambda fn: getattr(self, fn)()
原文地址:https://www.cnblogs.com/rsapaper/p/13563767.html