how to wait until pressing button in tkinter

Solutions on MaxInterview for how to wait until pressing button in tkinter by the best coders in the world

showing results for - "how to wait until pressing button in tkinter"
Zacharie
24 Feb 2016
1import tkinter as tk
2root = tk.Tk()
3...
4var = tk.IntVar()
5button = tk.Button(root, text="Click Me", command=lambda: var.set(1))
6button.place(relx=.5, rely=.5, anchor="c")
7
8print("waiting...")
9button.wait_variable(var)
10print("done waiting.")