I am unable to clear a text in my entry box item_rate1
.
In another box it deletes text, but in my second box doesn't clear at all. Error shown:
'NoneType' object has no attribute 'delete'
from tkinter import *
window= Tk()
window.geometry("650x250")
def clear_text():
text.delete(0, END)
item_rate1.delete(0, END)
rate1 = StringVar()
rate1.set("0")
text= Entry(window, width=40)
text.grid(row=0,column=0)
item_rate1 = Entry(window,textvariable=rate1).grid(row=1,column=0,sticky="w",ipadx=13,padx=35,)
Button(window,text="Clear", command=clear_text, font=('Helvetica bold',10)).grid(row=10,column=0)
window.mainloop()