1import pyautogui
2
3pyautogui.click(100, 100)
4pyautogui.moveTo(100, 150)
5pyautogui.moveRel(0, 10) # move mouse 10 pixels down
6pyautogui.dragTo(100, 150)
7pyautogui.dragRel(0, 10) # drag mouse 10 pixels down
1import mouse
2# Number of pixels to move by on x and y axis
3x = 1
4y = 2
5mouse.move(x, y)
1# Import modules
2import win32api, win32con
3
4# Set target position
5tx, ty = 0, 0
6
7# Mouse move event
8win32api.mouse_event(win32con.MOUSEEVENTF_MOVE | win32con.MOUSEEVENTF_ABSOLUTE, int(tx/win32api.GetSystemMetrics(0)*65535), int(ty/win32api.GetSystemMetrics(1)*65535) ,0 ,0)