diasbled python tkinter code example
Example 1: make tkinter btn disable
btn1['state'] = 'normal'
btn1['state'] = 'disabled'
Example 2: button state change in tknter
from tkinter import *
fenster = Tk()
fenster.title("Window")
def switch():
if(b1['state']==NORMAL):
b1["state"] = DISABLED
b2["text"]="enable"
elif (b1['state']==DISABLED):
b1["state"]=NORMAL
b2["text"]="disable"
b1=Button(fenster, text="Button")
b1.config(height = 5, width = 7)
b1.grid(row=0, column=0)
b2 = Button(text="disable", command=switch)
b2.grid(row=0,column=1)
fenster.mainloop()