python 获取函数名

# function.__name__
def temp_function():
    print('temp function')
print ("Function name: ", temp_function.__name__)
# sys
sys._getframe().f_code.co_name

https://blog.csdn.net/qq_43466807/article/details/100509852

你可能感兴趣的:(python 获取函数名)