Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to wait until pressing button in tkinter

import tkinter as tk
root = tk.Tk()
...
var = tk.IntVar()
button = tk.Button(root, text="Click Me", command=lambda: var.set(1))
button.place(relx=.5, rely=.5, anchor="c")

print("waiting...")
button.wait_variable(var)
print("done waiting.")
Comment

PREVIOUS NEXT
Code Example
Python :: mean code python 
Python :: update windows wallpaper python 
Python :: python test if string is int 
Python :: new event loop asyncio 
Python :: flask hello world 
Python :: how to create a file in a specific location in python 
Python :: simple thresholding with OpenCV 
Python :: combine 2 dataframes based on equal values in columns 
Python :: requests post with headers python 
Python :: how to move columns in a dataframen in python 
Python :: create pdf from images python 
Python :: how to make index column as a normal column 
Python :: python how to set multiple conditional for single var 
Python :: python list flatten 
Python :: django get user model funciton 
Python :: Import "dj_database_url" could not be resolved Pylance 
Python :: months of the year python list 
Python :: How to find the three largest values of an array efficiently, in Python? 
Python :: add static file in django 
Python :: drop na in pandas 
Python :: two input number sum in python 
Python :: python selenium assert presence of an element 
Python :: python: check type and ifno of a data frame 
Python :: convert list to binary python 
Python :: minute range python 
Python :: playsound 
Python :: researchpy correlation 
Python :: spacex 
Python :: all alphabets 
Python :: django queryset get all distinct 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =