MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/turtle.py:965–1003  ·  view source on GitHub ↗
(self, cv, mode=_CFG["mode"],
                 colormode=_CFG["colormode"], delay=_CFG["delay"])

Source from the content-addressed store, hash-verified

963 _RUNNING = True
964
965 def __init__(self, cv, mode=_CFG["mode"],
966 colormode=_CFG["colormode"], delay=_CFG["delay"]):
967 TurtleScreenBase.__init__(self, cv)
968
969 self._shapes = {
970 "arrow" : Shape("polygon", ((-10,0), (10,0), (0,10))),
971 "turtle" : Shape("polygon", ((0,16), (-2,14), (-1,10), (-4,7),
972 (-7,9), (-9,8), (-6,5), (-7,1), (-5,-3), (-8,-6),
973 (-6,-8), (-4,-5), (0,-7), (4,-5), (6,-8), (8,-6),
974 (5,-3), (7,1), (6,5), (9,8), (7,9), (4,7), (1,10),
975 (2,14))),
976 "circle" : Shape("polygon", ((10,0), (9.51,3.09), (8.09,5.88),
977 (5.88,8.09), (3.09,9.51), (0,10), (-3.09,9.51),
978 (-5.88,8.09), (-8.09,5.88), (-9.51,3.09), (-10,0),
979 (-9.51,-3.09), (-8.09,-5.88), (-5.88,-8.09),
980 (-3.09,-9.51), (-0.00,-10.00), (3.09,-9.51),
981 (5.88,-8.09), (8.09,-5.88), (9.51,-3.09))),
982 "square" : Shape("polygon", ((10,-10), (10,10), (-10,10),
983 (-10,-10))),
984 "triangle" : Shape("polygon", ((10,-5.77), (0,11.55),
985 (-10,-5.77))),
986 "classic": Shape("polygon", ((0,0),(-5,-9),(0,-7),(5,-9))),
987 "blank" : Shape("image", self._blankimage())
988 }
989
990 self._bgpics = {"nopic" : ""}
991
992 self._mode = mode
993 self._delayvalue = delay
994 self._colormode = _CFG["colormode"]
995 self._keys = []
996 self.clear()
997 if sys.platform == 'darwin':
998 # Force Turtle window to the front on OS X. This is needed because
999 # the Turtle window will show behind the Terminal window when you
1000 # start the demo from the command line.
1001 rootwindow = cv.winfo_toplevel()
1002 rootwindow.call('wm', 'attributes', '.', '-topmost', '1')
1003 rootwindow.call('wm', 'attributes', '.', '-topmost', '0')
1004
1005 def clear(self):
1006 """Delete all drawings and all turtles from the TurtleScreen.

Callers

nothing calls this directly

Calls 6

clearMethod · 0.95
ShapeClass · 0.85
_blankimageMethod · 0.80
winfo_toplevelMethod · 0.80
callMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected