How to lock tkinter button after pressing on it
问题 how to lock the button after pressing on it, until the other button is pressed or until I closed the program interface? 回答1: I'm not sure what you mean by locking the button, I think you mean disabling. Disabling is just you not being able to click the button until you define the state back to 'normal' Here is some sample code: from Tkinter import * def doDisable(): b2.configure(state=DISABLED) root = Tk() b2 = Button(root, text="Disable button", command=doDisable) b2.pack() root.mainloop()