第27529题 单选题
关于Python Tkinter中Button组件的带参事件绑定,下列写法正确的是?

现有如下Python代码片段,需要实现点击Tkinter按钮时调用带参数的show_message函数并打印指定内容:

import tkinter as tk
root = tk.Tk()
def show_message(msg):
    print(f"按钮点击提示:{msg}")

# 待完成Button组件的事件绑定

下列四个选项中,哪一个可以正确完成该绑定需求?

{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析