Jul-07-2019, 02:54 AM
why my destroy can't work when click clear
from tkinter import * a=Tk() a.title('Window') a.geometry('500x500+300+100') b=StringVar() #this will store value of textbox, now we have to print it so def com(): c=b.get() #this will get the value in C lab12=Label(text=c, font=20, fg='green').pack() #it will now print value in c def com1(): #clear.destroy() #c=b.get() #text11.destroy() #text11.delete(0, 'end') destroy() labl1=Label(text='Functionalityh to a button', font=30).pack() #label button1=Button(text='Press to print', command=com).pack() button2=Button(text='clear', command=com1).pack() text11 = Entry(textvariable=b).pack() a.mainloop()