我想要做的就是在GUI上包含的每個列表框上打印一個時間延遲。 我到目前爲止還沒有得到結果。我試圖使用time.sleep()...和方法之後。python-在tkinter的列表框打印之間使用延遲
這裏是我的代碼:
from Tkinter import *
def func() :
i = int (e.get())
for x in range (0,i):
listbox.insert (END, i)
i-=1
master = Tk()
master.title("hi")
e=Entry (master)
e.pack()
listbox = Listbox(master)
listbox.pack()
b = Button(master, text="get", width=10, command=func)
b.pack()
mainloop()
你應該看看'threading'模塊。 –