import inspect def trace_function(): print(f"當前執行的函式: {inspect.currentframe().f_code.co_name}") trace_function()