Oke i got the problem days ago and someone helped me with treading but my code was really ugly (im totaly new to coding) now i try to make it better and on an smarter way but now my gui get a frezze all time.
i tryed to do it on the way like my last code but it dosent work this time.
What have i to do this time i cant understand it but want understand it.
some Helpful Tips and tricks ?
Or better ways to do it smart, faster, and more powerfull, or mybae the gui more Beautyfule ?

```
import time
import sys
from tkinter import *
import threading

root = Tk()

root.geometry("600x400")

global start
start = 1

def startUp():
    user_input()
    thr = threading.Thread(target=user_input)
    thr.start()

def user_input():
    global nameInput
    global start
    nameInput = textBox.get("1.0","end-1c")
    start = 0
    if start < 1:
        while True:
            apex = ApexLegends("APIKey")
            player = apex.player(nameInput)
            print("Gesamt Kills: " + player.kills + "\n" + 'Gesamt Damage: ' + player.damage)
            time.sleep(3)
    else:
        print("stop")

anleitung=Label(text="Gib einen Spielernamen ein und drücke Start")
anleitung.pack()

textBox=Text(root, height=1, width=30)
textBox.pack()

startButton=Button(root, height=1, width=10, text="Start", command=lambda:startUp())
startButton.pack()

```