AttributeError: 'NoneType' object has no attribute 'destroy ...
ifelse.info › questions › 12401Feb 09, 2016 · AttributeError: 'NoneType' object has no attribute 'destroy'. To avoid placing all the code, I will recreate the error in a shorter way: import tkinter as tk ventana = tk.Frame ().pack () str_var = tk.StringVar () entrada = tk.Entry (ventana, textvariable= str_var).pack () boton_destruir = tk.Button (ventana, text="Destruir", command=lambda:entrada.destroy ()).pack (side="bottom")
Problem destroying a label. : learnpython
www.reddit.com › r › learnpythonThe following code gives the error "AttributeError: 'NoneType' object has no attribute 'destroy'" Why does it not recognise label1.destroy? How else can I achieve this? Thanks in advance for any help! import tkinter as tk. win = tk.Tk() label1 = tk.Label( text = "Label 1").pack() def label_delete(): label1.destroy()