I was using the following code to examine if Tkinter works along with multithreading. But the following code doesn't work (the Gui becomes unresponsive as soon as it runs). Can anyone please explain why it doesn't work?
from threading import Thread
import tkinter as tk
window = tk.Tk()
label = tk.Label(window, text='Hello')
label.pack()
def func():
i = 1
while True:
label['text'] = str(i)
i += 1
Thread(target=func).start()
Thread(target=window.mainloop).start()