import threading import time import tkinter as tk def change_bg(): root.config(bg="blue") print("bg changed") root = tk.Tk() threading.Thread(target=change_bg).start() # config call waits time.sleep(0.8) # wait times-out and RuntimeError raised #time.sleep(1.2) root.mainloop()