使用函数时,我无法在tkinter中销毁小部件
def first():
photo1 = PhotoImage(file =r"file/start.png")
photoimage1 = photo1.subsample(5,5)
start=Button(root,
width=270,
text="LAUNCH",
font=("orbitron",25),
image=photoimage1,
compound="left",
bg="white",
activebackground="white",
command=lambda:launch(1))
def des(var):
start.destroy()
它显示以下错误NameError: name 'start' is not defined
谁能告诉这个错误的解决方案
最佳答案
您可以使用def des(var)
下的def(first)
销毁
关于python - 使用函数时如何在Tkinter中销毁小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63091301/