I am programming in Python and I have a few questions that I can't find the answer to anywhere (please read all questions as they build up to my last question): What Does the .mainloop() really do? I read the all the answers in Stack Overflow, I also checked the documentations explanation. Does the .mainloop() always have to be at the end of a turtle program? I have used .mainloop() before. My question is, if I have the f.f.g code: import turtle screen = turtle.Screen() alex = turtle.Turtle() tess = turtle.Turtle() def yes(x, y): alex.onclick(yes) print("Hello World") tess.onclick(yes) turtle.mainloop() Why does alex (the first Turtle) get an action event when the function yes() is run? I know it does because the function is called, but what is actually happening? I mean the statement turtle.mainloop() is run before tess is clicked, and tess's action event is waited for in the event loop, so how does alex's event get in the event loop since its statement is run after turtle.mainloop() is run? Continue reading...