This program is much more dynamic , Pop ups will appear randomly .
import tkinter as tk import random import threading import time def boom(): window = tk.Tk() width = window.winfo_screenwidth() height = window.winfo_screenheight() a = random.randrange(0, width) b = random.randrange(0, height) window.title(' You are a fool ') window.geometry("200x50" + "+" + str(a) + "+" + str(b)) tk.Label(window, text=' You are a fool ', bg='green', font=(' Song style ', 17), width=20, height=4).pack() window.mainloop() threads = [] for i in range(100): t = threading.Thread(target=boom) threads.append(t) time.sleep(0.1) threads[i].start()
The operation effect is shown in the figure below , It's very exciting , It can be modified at will .