Tuesday, November 19, 2024
Google search engine
HomeLanguagesturtle.resizemode() function in Python

turtle.resizemode() 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.resizemode()

This function is used set resizemode to one of the values: “auto”, “user”, “noresize”. If no argument is given, return the current resizemode. resizemode(“user”) is called by a call of shapesize with arguments.

Syntax : turtle.resizemode(rmode=None)

Parameters:

rmode (optional): one of the strings “auto”, “user”, “noresize”

Different resizemodes have the following effects:

  • “auto” adapts the appearance of the turtle corresponding to the value of pensize.
  • “user” adapts the appearance of the turtle according to the values of stretchfactor and outlinewidth (outline), which are set by shapesize()
  • “noresize” no adaption of the turtle’s appearance takes place.

Below is the implementation of the above method with some examples :

Example 1 :

Python3




# importing package
import turtle
  
# check default value
print(turtle.resizemode())


Output :

noresize

Example 2 :

Python3




# importing package
import turtle
  
# print default value
print(turtle.resizemode())
  
# change mode to auto and check
turtle.resizemode(rmode="auto")
print(turtle.resizemode())
  
# change mode to user and check
turtle.resizemode(rmode="user")
print(turtle.resizemode())


Output :

noresize
auto
user
Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments