How does one control the mouse cursor in Python, i.e. move it to certain position and click, under Windows?
The accepted answer worked for me but it was unstable (sometimes clicks wouldn't regsiter) so I added an additional MOUSEEVENTF_LEFTUP . Then it was working reliably
import win32api, win32con
def click(x,y):
win32api.SetCursorPos((x,y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
click(10,10)