turtle.screensize()

turtle.screensize(canvwidth=None, canvheight=None, bg=None)

Parameters:
  • canvwidth – positive integer, new width of canvas in pixels
  • canvheight – positive integer, new height of canvas in pixels
  • bg – colorstring or color-tuple, new background color

If no arguments are given, return current (canvaswidth, canvasheight). Else resize the canvas the turtles are drawing on. Do not alter the drawing window. To observe hidden parts of the canvas, use the scrollbars. With this method, one can make visible those parts of a drawing which were outside the canvas before.

>>> screen.screensize()
(400, 300)
>>> screen.screensize(2000,1500)
>>> screen.screensize()
(2000, 1500)

e.g. to search for an erroneously escaped turtle ;-)

doc_python
2016-10-07 17:45:39
Comments
Leave a Comment

Please login to continue.