添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
腼腆的酱牛肉  ·  Initializing the ...·  5 月前    · 
刚分手的人字拖  ·  Spatio-temporal ...·  6 月前    · 
苦闷的手术刀  ·  How to append rows ...·  9 月前    · 
笑点低的小摩托  ·  laravel ...·  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()
        
            
                    improve this answer