from tkinter import* root=Tk() root.mainloop
def task(): # do something root.update() while 1: task()