lambda 表达式 事件传参应用
from tkinter import *
window = Tk()
window.geometry("500x200")
def MouseTest1():
print("command方法, 简单情况, 不涉及获取event对象")
def MouseTest2(a, b):
print("爸爸是:{0},儿子是:{1}".format(a, b))
Button(window, text="测试command1",
command=MouseTest1).pack(side="left")
Button(window, text="测试command2",
command=lambda:MouseTest2("XIAOHAN", "XIAOZI")).pack(side="left")
window.mainloop()