turtle.getscreen() function in Python
Last Updated :
23 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.getscreen()
This function is used to Return the TurtleScreen object, the turtle is drawing on. It doesn’t require any argument. So TurtleScreen-methods can be called for that object.
Syntax :
turtle.getscreen()
Below is the implementation of the above method with some examples :
Example 1 :
Python3
import turtle
sc = turtle.getscreen()
print (sc)
|
Output :
<__main__.Screen object>
Example 2 :
Python3
import turtle
sc = turtle.getscreen()
sc.setup( 400 , 400 )
sc.bgcolor( "blue" )
|
Output :
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...