When writing your own loop, as in the simulation (I assume), you need to call the update
function which does what the mainloop
does: updates the window with your changes, but you do it in your loop.
def task():
# do something
root.update()
while 1:
task()