使用 PyAutoGUICursor 来对鼠标和键盘进行操作
This commit is contained in:
parent
4b11569915
commit
e5eabb0a17
|
@ -4,4 +4,5 @@ python-dateutil~=2.8.1
|
||||||
setuptools~=54.0.0
|
setuptools~=54.0.0
|
||||||
ruamel.yaml
|
ruamel.yaml
|
||||||
qrcode
|
qrcode
|
||||||
Pillow
|
Pillow
|
||||||
|
pyautogui
|
|
@ -0,0 +1,32 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Python Random String Password
|
||||||
|
# Author - HoneyMoose(huyuchengus@gmail.com)
|
||||||
|
# Link Article - https://www.ossez.com/t/python/13398
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
import pyautogui
|
||||||
|
|
||||||
|
while True:
|
||||||
|
# 移动鼠标,duration=0.1是鼠标移动过程中的延迟速度
|
||||||
|
pyautogui.moveTo(x=300, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
# 移动鼠标到坐标后,单击左键
|
||||||
|
pyautogui.click(x=700, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
# 移动鼠标到坐标后,双击左键
|
||||||
|
pyautogui.doubleClick(x=600, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
# 移动鼠标到坐标后,单击右键
|
||||||
|
pyautogui.rightClick(x=700, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
pyautogui.click(x=100, y=200)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
pyautogui.click(x=200, y=400)
|
||||||
|
time.sleep(3)
|
Loading…
Reference in New Issue