b = Button(root3,text="ADD",command=lambda: update_file(str(ent1.get()),str(ent3.get()),str(ent2.get())))
我有这个错误:
File "C:/Users/khaled/PycharmProjects/projectAI/fathy1.py", line 29, in <lambda>
b = Button(root3,text="ADD",fg="white",bg="blue",width=10,command=lambda: update_file(str(ent1.get()),str(ent3.get()),str(ent2.get())))
答案 0 :(得分:0)
定义一个函数并将命令名称作为该函数名称
def myFun():
update_file(str(ent1.get()),str(ent3.get()),str(ent2.get()))
b = Button(root3,text="ADD",command=myFun)