import time
import tkinter as tk
def write_text():
text.insert(tk.END, str(time.time()) + '\n')
root.after(1000, write_text) # again forever
root = tk.Tk()
text = tk.Text(root)
text.pack()
root.after(1000, write_text)
root.mainloop()
TKinter做个时间戳记录器
最新推荐文章于 2024-08-28 16:14:15 发布