My program streams data and I want to create a popup displaying some text whenever a condition is met. I tried to create a simple tkinter window and ctypes window, but both seem to block my code, preventing it from continuing until the window has been closed. How can I create simple popup window functionality in for example a loop?
What I have so far is something of this structure.
import tkinter as tk
for i in range(11):
if i%5 == 0: # Any condition
popup = tk.Tk()
label = ttk.Label(popup, text='hi', font=('Verdana', 12))
label.pack(side='top', padx=10, pady=10)
popup.mainloop()
and
import ctypes
for i in range(11):
if i%5 == 0: # Any condition
popup = ctypes.windll.user32.MessageBoxW
popup(None, 'hi', 'title', 0)
However, in both cases the loop will not proceed until I close the popup.