5秒后清空窗口

This commit is contained in:
张梦南 2025-11-14 14:21:48 +08:00
parent 7a80291e54
commit 46f215dafa

View File

@ -38,16 +38,19 @@ def create_float_windows(root):
width=15,
height=2).pack()
def create_windows_periodicoally(root, count=100, delay=50):
def create_windows_periodically(root, count=100, delay=50):
if count > 0:
create_float_windows(root)
root.after(delay, create_windows_periodicoally, root, count - 1, delay)
root.after(delay, create_windows_periodically, root, count - 1, delay)
else:
root.after(5000, root.quit)
if __name__ == "__main__":
root = tk.Tk()
root.withdraw()
create_windows_periodicoally(root, 200, 70)
create_windows_periodically(root, 200, 70)
root.mainloop()