|
from tkinter import *
from _thread import start_new_thread
from time import sleep
def run():
for i in range(0, 10):
message.insert(END, str(i)+"\n")
sleep(1)
root = Tk()
root.title("测试")
root.geometry('320x240')
message = Text(root)
message.place(relx=0.05, rely=0.02, relwidth=0.9, relheight=0.7)
start_new_thread(run, ())
mainloop()
要使用多线程 |
|