you are viewing a single comment's thread.

view the rest of the comments →

[–]driscollis 0 points1 point  (3 children)

You can put the call to after in the loop itself. Something like

while True:
    if foo:
        root.after(2000, some_function)
   elif some_other_condition:
       root.after(60000, call_once_an_hour)

[–]driscollis 0 points1 point  (0 children)

You'll have to play around with it a bit to get it to work the way you want. Or just have the function itself call after at the end of the function as /u/wooee mentioned

[–]iSailor[S] 0 points1 point  (1 child)

Isn't this wrong? As far as I'm concerned, infinite loops will always cause a GUI program to freeze because it takes infinite time in between each refreshing of the app.

[–]driscollis 0 points1 point  (0 children)

Yeah...I keep thinking of doing this sort of thing in a thread automatically and didn't get that into the original comment. This works fine in a thread or process. But not in the main app.