Ich habe Probleme mit meinem Programm.
Mit meinem Programm will ich etwas mit thread ausprobieren , doch es klappt
nicht so wie ich will.
Code: Alles auswählen
import time
import _thread
from tkinter import*
anzahl = 0
def jannik(n,k):
while 10:
global anzahl
anzahl=anzahl+1
time.sleep(1)
def janni(x,o):
while 10:
lS.config(text=str(anzahl))
time.sleep(4)
root=Tk()
root.title("test")
root.geometry("300x300")
lS = Label(master=root,text='??')
lS.pack()
root.mainloop()
_thread.start_new_thread(jannik,("k",0,))
_thread.start_new_thread(janni, ("a",1,))
Doch es klappt leider nicht

Könnt ihr mir helfen?