📜  在 tkinter 中运行循环 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:10.472000             🧑  作者: Mango

代码示例1
from tkinter import *

root = Tk()

def task():
    print("hello")
    root.after(2000, task)  # reschedule event in 2 seconds

root.after(2000, task)
root.mainloop()