-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawing_Circles.py
More file actions
31 lines (28 loc) · 980 Bytes
/
Drawing_Circles.py
File metadata and controls
31 lines (28 loc) · 980 Bytes
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
import pyautogui, math, time
time.sleep(3) # open paint in this time frame
i = 828
j = 60
print(pyautogui.size()) # For mine, the output is Size(width=1366, height=768)
for radius in range(20, 220, 20):
pyautogui.click(325, 70) # click on brush
pyautogui.moveTo(768, 60) # pick black color
pyautogui.click()
t = 0
while t <= 360:
x = 600 + round(radius * math.cos(t * (math.pi / 180))) # using parametric equation of circle
y = 400 + round(radius * math.sin(t * (math.pi / 180)))
if t == 0:
pyautogui.moveTo(x, y)
else:
pyautogui.dragTo(x, y)
t += 10 # for smooth circle
pyautogui.click(265, 70) # click on bucket
if i < 970:
pyautogui.moveTo(i, j) # picking different colors
i += 21
else:
i = 828
j = 80
pyautogui.click()
pyautogui.moveTo(600 + (radius - 5), 400)
pyautogui.click()