X7ROOT File Manager
Current Path:
/lib64/python3.8/turtledemo
lib64
/
python3.8
/
turtledemo
/
ðŸ“
..
📄
__init__.py
(314 B)
📄
__main__.py
(13.91 KB)
ðŸ“
__pycache__
📄
bytedesign.py
(4.15 KB)
📄
chaos.py
(951 B)
📄
clock.py
(3.13 KB)
📄
colormixer.py
(1.31 KB)
📄
forest.py
(2.9 KB)
📄
fractalcurves.py
(3.39 KB)
📄
lindenmayer.py
(2.38 KB)
📄
minimal_hanoi.py
(2 KB)
📄
nim.py
(6.36 KB)
📄
paint.py
(1.26 KB)
📄
peace.py
(1.04 KB)
📄
penrose.py
(3.3 KB)
📄
planet_and_moon.py
(2.76 KB)
📄
rosette.py
(1.33 KB)
📄
round_dance.py
(1.76 KB)
📄
sorting_animate.py
(4.91 KB)
📄
tree.py
(1.37 KB)
📄
turtle.cfg
(160 B)
📄
two_canvases.py
(1.09 KB)
📄
yinyang.py
(820 B)
Editing: colormixer.py
# colormixer from turtle import Screen, Turtle, mainloop class ColorTurtle(Turtle): def __init__(self, x, y): Turtle.__init__(self) self.shape("turtle") self.resizemode("user") self.shapesize(3,3,5) self.pensize(10) self._color = [0,0,0] self.x = x self._color[x] = y self.color(self._color) self.speed(0) self.left(90) self.pu() self.goto(x,0) self.pd() self.sety(1) self.pu() self.sety(y) self.pencolor("gray25") self.ondrag(self.shift) def shift(self, x, y): self.sety(max(0,min(y,1))) self._color[self.x] = self.ycor() self.fillcolor(self._color) setbgcolor() def setbgcolor(): screen.bgcolor(red.ycor(), green.ycor(), blue.ycor()) def main(): global screen, red, green, blue screen = Screen() screen.delay(0) screen.setworldcoordinates(-1, -0.3, 3, 1.3) red = ColorTurtle(0, .5) green = ColorTurtle(1, .5) blue = ColorTurtle(2, .5) setbgcolor() writer = Turtle() writer.ht() writer.pu() writer.goto(1,1.15) writer.write("DRAG!",align="center",font=("Arial",30,("bold","italic"))) return "EVENTLOOP" if __name__ == "__main__": msg = main() print(msg) mainloop()
Upload File
Create Folder