import tkinter as tk
my_w = tk.Tk()
my_w.geometry("400x200") # width and height of the window
font1=('Times',22,'normal') # declaring font Family, size and style
def my_upd():
if b2['text']=='Click Me to Agree': # check the text of 2nd button
b2.flash() # flashing the button
else:
b2['text']='Click Me to Agree' # change the text on the button
b1=tk.Button(my_w,text='Submit',font=font1,bd=6,command=my_upd)
b1.grid(row=0,column=1,padx=10,pady=60)
b2=tk.Button(my_w,text='Click Me to Agree',font=font1,bd=6,width=14,
command=lambda:b2.config(text='I agree'),
activebackground='red',activeforeground='yellow')
b2.grid(row=0,column=2,padx=5,pady=60)
my_w.mainloop()
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.