Something like this:
from Tkinter import *
root = Tk()
but = Button(root, text = "button")
but.pack()
#When I try:
but.destroy()
but.pack()
I get an error:
TclError: bad window path name ".37111768"
I have managed to get it working :) here is my work:
from Tkinter import *
def changebutton():
but.destroy()
secondbut=Button(root,text="changed")
secondbut.pack()
if __name__=='__main__':
root=Tk()
global but
but= Button(root,text="button",command=changebutton)
but.pack()
root.mainloop()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With