turtle.setundobuffer() function in Python Last Updated : 17 May, 2021 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.setundobuffer() This function is used to set or disable undobuffer. It takes the size parameter. If the size is an integer an empty undobuffer of a given size is installed. Size gives the maximum number of turtle-actions that can be undone by the undo() function. If the size is None, no undobuffer is present. Syntax : turtle.setundobuffer(size) Below is the implementation of the above method with some examples : Example 1 : Python3 # importing package import turtle # check default value of undobuffer print(turtle.undobufferentries()) # set undo buffer by 10 as value turtle.setundobuffer(10) # loop executes 50 times with # turtle.forward(1) statement # i.e; undobufferentries gives 50 for i in range(50): turtle.forward(1) # but gives 10 as it is set already print(turtle.undobufferentries()) Output : 0 10 Example 2 : Python3 # importing package import turtle # print default value print(turtle.undobufferentries()) # loop for motion for i in range(50): # one statement increase the # undobuffer entries turtle.fd(1) # print undobuffer entries ie; 50 # due to above loop with one statement print(turtle.undobufferentries()) # set undobuffer to None turtle.setundobuffer(None) # print undobuffer entries # i.e; value set by set undobuffer print(turtle.undobufferentries()) Output : 0 50 0 Comment More infoAdvertise with us Next Article turtle.setundobuffer() function in Python D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads turtle.sety() 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.sety() This method is used to set the turtle's second coordinate to y, leavi 1 min read turtle.setx() 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.setx() This method is used to set the turtle's first coordinate to x, leave 1 min read turtle.seth() 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.seth() This method is used to set the orientation of the turtle to to_angle. 2 min read turtle.reset() 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.reset() This function is used to delete the turtle's drawings and restore it 1 min read turtle.speed() function in Python The turtle module in Python enables graphics and animations using Tkinter. It supports object-oriented and procedural approaches. The turtle.speed() method is used to control the speed of the turtle's movement. It accepts a numerical value or a predefined string and adjusts the turtle's speed accord 2 min read turtle.tracer() 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.tracer() This function is used to turn turtle animation on or off and set a 1 min read turtle.shearfactor() 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.shearfactor() This function is used to set or return the current shearfactor 1 min read turtle.settiltangle() 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.settiltangle() This function is used to rotate the turtleshape to point in t 2 min read turtle.shapetransform() 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.shapetransform() This function is used to set or return the current transfor 2 min read Like