After the tkinter gui is open i want to change the name every x seconds referencing from an api in my code
ws.mainloop() # ----------------------------------------- starttime = time.time() while True: Value1 = data["session"]["gameType"] Value2 = data["session"]["mode"] Value3 = ' / ' Value = Value1 + Value3 + Value2 ws.title(Value.lower()) time.sleep(60.0 - ((time.time() - starttime) % 60.0)) After the gui opens anything below it does not get ran until the program is closed.
mainloopwill not exit until the application is closed, and should be the last thing in yourmain. You must usews.afterto request a callback after a certain amount of time. You must think "event driven", and not linear.