這是我的代碼:文本不會出現Tkinter的GUI
from tkinter import *
import time
count = 0
while count >= 0 :
print(count)
time.sleep(1)
count = count + 1
root= Tk()
label1= Label(root, text='Gegevens', bg='lightblue')
label2= Label(root, text='Voortgang')
labelfiets_prestatie= Label (root, text='Fiets_Prestatie',)
labelStappen= Label(root, text='Meter', command= count, bg='red')
label1.pack(fill= X)
label2.pack()
labelfiets_prestatie.pack()
labelStappen.pack()
root.mainloop()
現在我的問題是,每當我刪除出現在GUI中的計數代碼,但我想這是產生在被觀察到的數字GUI。它出了什麼問題?
不要在'tkinter'中使用'.sleep()'。 – Lafexlos