Запланируйте функцию Python внутри петли Tkinter
root = Tk()
Alert Albatross
root = Tk()
def task():
root.after(2000, task) # reschedule event in 2 seconds
print("hello")
root.after(2000, task)
root.mainloop()