turtle.window_height() function in Python (original) (raw)
Last Updated : 26 Jul, 2020
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.window_height()
This function is used to return the height of the turtle window. It doesn't require any argument.
Syntax :
turtle.window_height()
Below is the implementation of the above method with an example :
Python3 `
import package
import turtle
get turtle window height
print(turtle.window_height())
make screen object
then set size and color
sc = turtle.Screen() sc.setup(300,300) sc.bgcolor("green")
get turtle window height
print(turtle.window_height())
loops for pass time
for i in range(5000): for j in range(5000): pass
set size and color again
sc.setup(500,400) sc.bgcolor("red")
get turtle window height
print(turtle.window_height())
`
Output :
648 300 400
Similar Reads
- turtle.window_width() 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.window_width() This function is used to return the width of the turtle windo 1 min read
- turtle.width() 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.width() This method is used to set or return the line thickness. Set the lin 2 min read
- turtle.heading() 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.heading() This function is used to return the turtle's current heading. It d 1 min read
- turtle.home() 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.home() This function is used to move the turtle to the origin i.e. coordinat 1 min read
- turtle.write() function in Python turtle module in Python provides a way to create graphics and animations using Tkinter. The turtle.write() method is used to display text at the turtle’s current position on the canvas. This function helps in labeling graphics, adding instructions or displaying values dynamically. It allows both obj 3 min read
- turtle.getpen() 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.getpen() This function is used to return the Turtleobject itself. It doesn't 1 min read
- turtle.xcor() 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.xcor() This function is used to return the turtle's x coordinate of the curr 1 min read
- turtle.ycor() 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.ycor() This function is used to return the turtle's y coordinate of the curr 1 min read
- turtle.hideturtle() 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.hideturtle() This method is used to make the turtle invisible. It's a good i 1 min read
- turtle.getscreen() 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.getscreen() This function is used to Return the TurtleScreen object, the tur 1 min read