5秒后清空窗口
This commit is contained in:
parent
7a80291e54
commit
46f215dafa
9
main.py
9
main.py
@ -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()
|
||||
Loading…
x
Reference in New Issue
Block a user