1from tkinter import *
2fenster = Tk()
3fenster.title("Window")
4
5def switch():
6 if(b1['state']==NORMAL):
7 b1["state"] = DISABLED
8 b2["text"]="enable"
9 elif (b1['state']==DISABLED):
10 b1["state"]=NORMAL
11 b2["text"]="disable"
12
13#--Buttons
14b1=Button(fenster, text="Button")
15b1.config(height = 5, width = 7)
16b1.grid(row=0, column=0)
17b2 = Button(text="disable", command=switch)
18b2.grid(row=0,column=1)
19fenster.mainloop()