how to move mouse in a cercle in python

Solutions on MaxInterview for how to move mouse in a cercle in python by the best coders in the world

showing results for - "how to move mouse in a cercle in python"
Phebian
08 May 2017
1import pyautogui
2import math
3
4# Radius 
5R = 400
6# measuring screen size
7(x,y) = pyautogui.size()
8# locating center of the screen 
9(X,Y) = pyautogui.position(x/2,y/2)
10# offsetting by radius 
11pyautogui.moveTo(X+R,Y)
12
13for i in range(360):
14    # setting pace with a modulus 
15    if i%6==0:
16       pyautogui.moveTo(X+R*math.cos(math.radians(i)),Y+R*math.sin(math.radians(i)))