【python】自动获取鼠标位置_turtle获取鼠标坐标-CSDN博客

网站介绍:文章浏览阅读2.4k次。通过pyautogui这个库来实现。1、安装pyautogui库,通过pip安装即可pip install pyautogui2、具体代码:from turtle import positionimport pyautogui, sysprint("press ctrl-c to quit.")try: while True: x, y = pyautogui.position() positionStr = "X: " + str(x).rjust(_turtle获取鼠标坐标