Getting cursor position in Python

后端 未结 11 1138
旧巷少年郎
旧巷少年郎 2020-12-02 22:29

Is it possible to get the overall cursor position in Windows using the standard Python libraries?

11条回答
  •  伪装坚强ぢ
    2020-12-02 23:13

    Using pyautogui

    To install

    pip install pyautogui

    and to find the location of the mouse pointer

    import pyautogui
    print(pyautogui.position())
    

    This will give the pixel location to which mouse pointer is at.

提交回复
热议问题