lambda, 匿名函数, 变量,传参

lambda:
# 无参数函数情况
def delete_one():
     pass
Button(otherFrame, text="删除", width=4, command=delete_one)

# 有参数的函数,且自带参数event
doub_event =lambda event: self.item_clicked(event, otherFrame)
self.tree.tag_bind('ttk', '<Double-Button-1>', doub_event )

 

posted @ 2017-10-24 17:59  x.cube  阅读(1297)  评论(0编辑  收藏  举报