Python - turtle.exitonclick() Last Updated : 17 Aug, 2020 Comments Improve Suggest changes Like Article Like Report The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.exitonclick() : This function is used to Go into mainloop until the mouse is clicked. It doesn't require any argument. Bind bye() method to mouseclick on TurtleScreen. If using_IDLE - value in configuration dictionary is False (default value), enter mainloop. If IDLE with -n switch (no subprocess) is used, this value should be set to True in turtle.cfg. In this case IDLE's mainloop is active also for the client script. This is a method of the Screen-class and not available for TurtleScreen instances. Syntax : turtle.exitoncick() Parameters : None Returns : Nothing Below is the implementation of above method with an example : Example : python3 # import package import turtle # loop for motion for i in range(3): turtle.circle(40) turtle.right(120) # exit from the screen # if and only if # mouse is clicked turtle.exitonclick() Output : Here we can see that : Turtle screen is loadedTurtle draw some stuffTurtle window remain as it isWhen user click (yellow colored sign) on turtle window it closes i.e; exit on click. Comment More infoAdvertise with us Next Article Python - turtle.exitonclick() D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads turtle.onclick() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.onclick() This function is used to bind fun to a mouse-click event on this t 1 min read Python - turtle.done() The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.done() This function is used to starts event loop - calling Tkinter's main l 1 min read Python - turtle.pencolor() method The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.pencolor() : This method is used to change the color of the ink of the turtl 2 min read Python - turtle.clear() The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.clear() This function is used to delete the turtle's drawings from the scree 2 min read Python - turtle.bye() The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.bye() This function is used to shut the turtle graphics window. It doesn't r 1 min read turtle.onscreenclick() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.onscreenclick() This function is used to bind fun to a mouse-click event on 2 min read turtle.onkey() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.onkey() This function is used to bind fun to the key-release event of the ke 1 min read turtle.end_fill() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.end_fill() This method is used to Fill the shape drawn after the call begin_ 1 min read turtle.bgpic() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.bgpic() This function is used to set a background image or return name of th 1 min read turtle.clone() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.clone() The turtle.clone() method is used to create and return a clone of th 2 min read Like