Search code examples
windowspython-2.7mouse-cursor

move mouse with python on windows 7


How can I move the mouse cursor in python 2.7 on Windows 7?

def MoveMouse(x,y):
    #move mouse cursor

Solution

  • what you need is Win32api.

    
    import win32api
    def move_to(x,y):
        win32api.SetCursorPos((x,y))