实现鼠标一直运动
-
安装好Python和pip,并保证二者能够正常使用;
-
使用下方命令安装指定版本的
pyautogui库:
pip install pyautogui==0.9.50
- 撰写下方代码:
import pyautogui
import random
import time
while True:
x = random.randint(-200, 200)
y = random.randint(-200, 200)
pyautogui.moveRel(x, y)
time.sleep(5)
- 运行写入上方代码的脚本,即可看到效果。
作者:艾孜尔江
本文来自博客园,作者:艾孜尔江,转载请注明原文链接:https://www.cnblogs.com/ezhar/p/15915231.html

浙公网安备 33010602011771号