Python tkinter threading kullanımı

kodları atarken mantıklı bir şekilde atarsan daha iyi olur. yazdığım kod istediğin şey galiba.

from tkinter import *
import time
import threading

frame_orta = Tk()

def istek():
    time.sleep(3)
    b1.config(text="cagedbeyolsunhadi")
    print("cagedbey")

def asdf():
    x = threading.Thread(target=istek,daemon=True)
    x.start()
b1 = Button(frame_orta,text="Gönder",background="red",command=asdf)
b1.pack()

frame_orta.mainloop()
2 Beğeni