From 21329f72ccaf6943ec8b35183020a95af8e71b99 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Sat, 20 Mar 2021 11:45:30 -0400 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=94=BB=E5=9B=BE=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/PyAutoGUICursor.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/PyAutoGUICursor.py b/tests/PyAutoGUICursor.py index a92de72..59bb372 100644 --- a/tests/PyAutoGUICursor.py +++ b/tests/PyAutoGUICursor.py @@ -2,7 +2,7 @@ # Python Random String Password # Author - HoneyMoose(huyuchengus@gmail.com) -# Link Article - https://www.ossez.com/t/python/13398 +# Link Article - https://www.ossez.com/t/python-pyautogui/13400 import time @@ -26,7 +26,21 @@ while True: time.sleep(3) pyautogui.click(x=100, y=200) - time.sleep(3) + time.sleep(10) pyautogui.click(x=200, y=400) - time.sleep(3) + time.sleep(10) + + # 可以在 Windows 中打开 Paint,然后执行下面的语句 + distance = 200 + while distance > 0: + pyautogui.drag(distance, 0, duration=0.5) # move right + distance -= 5 + pyautogui.drag(0, distance, duration=0.5) # move down + pyautogui.drag(-distance, 0, duration=0.5) # move left + distance -= 5 + pyautogui.drag(0, -distance, duration=0.5) # move up + time.sleep(10) + + +