Python Forum
main lop in python tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
main lop in python tkinter
#7
The function is not calling itself. That would quickly run into the maximum recursion limit and the program would crash. Instead print_it() is telling root to call print_it() 100 milliseconds from now.

The reason your implementation didn't work is because after() only schedules a function to run once. Your program called PrintIt() 10 milliseconds after the it root.after() call, and nobody ever scheduled it to run again.
Reply


Messages In This Thread
main lop in python tkinter - by barryjo - Jan-23-2022, 04:57 PM
RE: main lop in python tkinter - by menator01 - Jan-23-2022, 06:19 PM
RE: main lop in python tkinter - by BashBedlam - Jan-23-2022, 09:36 PM
RE: main lop in python tkinter - by barryjo - Jan-23-2022, 11:50 PM
RE: main lop in python tkinter - by menator01 - Jan-23-2022, 11:55 PM
RE: main lop in python tkinter - by barryjo - Jan-24-2022, 01:25 AM
RE: main lop in python tkinter - by deanhystad - Jan-24-2022, 03:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  "tkinter.TclError: NULL main window" Rama02 1 5,950 Feb-04-2021, 06:45 PM
Last Post: deanhystad
  “main thread is not in main loop” in Tkinter Long_r 1 24,468 Jun-26-2019, 11:00 PM
Last Post: metulburr
  GTK main window calling a main window DennisT 4 6,955 Oct-19-2016, 09:36 PM
Last Post: DennisT

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020