Python 在屏幕上滑动鼠标

Python Glide mouse across screen

在这样的代码中:

import pyautogui
pyautogui.click(100,200)

或者

Import pyautogui
pyautogui.moveTo(100,150)
pytautogui.click()

鼠标光标跳转到指定位置,如何让鼠标光标滑行而不是跳跃来刺激人类鼠标移动

这直接取自moveTo的文档:

Normally the mouse cursor will instantly move to the new coordinates. If you want the mouse to gradually move to the new location, pass a third argument for the duration (in seconds) the movement should take. For example:

>>> pyautogui.moveTo(100, 200, 2)   # moves mouse to X of 100, Y of 200 over 2 seconds