Avatar ·

النوم و while True في tkinter

📁 مناقشة, نصيحة, بايثون 3, مبتدئ

على سبيل المثال، يوجد كود:

def tk_sleep():
status_send = Tk()
status_send.geometry('400x340')
tx_1 = Text(status_send, font=('times', 12), width=62, height=15, wrap=WORD)
tx_1.pack()
for i in range(10):
tx_1.insert(1.0, 'hello world')
tx_1.update()
sleep(5)

وبهذا تتجمد النافذة بأكملها مع الـ widget. كيف يمكن تجنب ذلك؟