Repository navigation
Expand file tree
/
Copy pathinterface_paint.py
More file actions
86 lines (86 loc) · 1.84 KB
/
Copy pathinterface_paint.py
File metadata and controls
86 lines (86 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import turtle
import snake
def clickcolor(x, y):
print(x, y)
if x <= 620 and x > 600 and y >=330 and y < 350:
snake.pengreen()
elif x <= 620 and x > 600 and y <= 320 and y > 300:
snake.penblue()
elif x <= 590 and x > 570 and y >=330 and y < 350:
snake.penred()
elif x <= 590 and x > 570 and y <= 320 and y > 300:
snake.penyellow()
elif x >= -610 and x < -590 and y <= 320 and y > 300:
snake.pen.pensize(3)
elif x >= -580 and x < -560 and y <= 330 and y > 300:
snake.pen.pensize(4)
elif x >= -550 and x < -510 and y <= 340 and y > 300:
snake.pen.pensize(7)
elif x >= -500 and x < -450 and y <= 360 and y > 300:
snake.pen.pensize(10)
sc2 = turtle.Screen()
sc2.title('Paint for my friends(from Sergey Ledovskikh)')
sc2.setup(1280, 720)
sc2.onclick(clickcolor)
i = turtle.Turtle()
i.up()
i.goto(-195, 320)
i.down()
i.write("Нажмите на кнопку 'c' для очистки простраства для рисования\n(Английская раскладка)", font=("Verdana", 8))
i.speed(10)
i.up()
i.goto(600, 330)
i.down()
i.color('green')
i.begin_fill()
for green in range(4):
i.forward(20)
i.left(90)
i.end_fill()
i.up()
i.goto(600, 300)
i.down()
i.color('blue')
i.begin_fill()
for blue in range(4):
i.forward(20)
i.left(90)
i.end_fill()
i.up()
i.goto(570, 330)
i.down()
i.color('red')
i.begin_fill()
for red in range(4):
i.forward(20)
i.left(90)
i.end_fill()
i.up()
i.goto(570, 300)
i.down()
i.color('yellow')
i.begin_fill()
for yellow in range(4):
i.forward(20)
i.left(90)
i.end_fill()
i.up()
i.goto(-600, 300)
i.down()
i.begin_fill()
i.color('black')
i.circle(10)
i.up()
i.goto(-570, 300)
i.down()
i.circle(15)
i.up()
i.goto(-530, 300)
i.down()
i.circle(20)
i.up()
i.goto(-470, 300)
i.down()
i.circle(29)
i.end_fill()
i.hideturtle()