MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/turtledemo/colormixer.py:6–25  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

4class ColorTurtle(Turtle):
5
6 def __init__(self, x, y):
7 Turtle.__init__(self)
8 self.shape("turtle")
9 self.resizemode("user")
10 self.shapesize(3,3,5)
11 self.pensize(10)
12 self._color = [0,0,0]
13 self.x = x
14 self._color[x] = y
15 self.color(self._color)
16 self.speed(0)
17 self.left(90)
18 self.pu()
19 self.goto(x,0)
20 self.pd()
21 self.sety(1)
22 self.pu()
23 self.sety(y)
24 self.pencolor("gray25")
25 self.ondrag(self.shift)
26
27 def shift(self, x, y):
28 self.sety(max(0,min(y,1)))

Callers

nothing calls this directly

Calls 11

shapeMethod · 0.80
resizemodeMethod · 0.80
shapesizeMethod · 0.80
pensizeMethod · 0.80
leftMethod · 0.80
gotoMethod · 0.80
setyMethod · 0.80
pencolorMethod · 0.80
ondragMethod · 0.80
colorMethod · 0.45
speedMethod · 0.45

Tested by

no test coverage detected