添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
眼睛小的柚子  ·  06.02 | ...·  2 年前    · 
温暖的书包  ·  Jupyter Notebook:no ...·  2 年前    · 
痛苦的投影仪  ·  顶会论文分享 - 知乎·  2 年前    · 

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()
        
            
                    improve this answer