From b2f12db83acc201331c68f5cb7b5dc16a9ab1fb3 Mon Sep 17 00:00:00 2001 From: naibo Date: Sun, 9 Jul 2023 09:45:32 +0800 Subject: [PATCH] Change keyboard module --- .../Code/easyspider_executestage.py | 2 +- ExecuteStage/easyspider_executestage.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.temp_to_pub/EasySpider_windows_x64/Code/easyspider_executestage.py b/.temp_to_pub/EasySpider_windows_x64/Code/easyspider_executestage.py index ea3948a..3c26ee9 100644 --- a/.temp_to_pub/EasySpider_windows_x64/Code/easyspider_executestage.py +++ b/.temp_to_pub/EasySpider_windows_x64/Code/easyspider_executestage.py @@ -1511,7 +1511,7 @@ if __name__ == '__main__': time.sleep(3) print("\n\n----------------------------------") print("正在运行任务,按键盘p键可暂停任务的执行以便手工操作浏览器如输入验证码;如果想恢复任务的执行,请再次按p键。") - print("Running task, long press 'p' to pause the task for manual operation of the browser such as entering the verification code; If you want to resume the execution of the task, please long press 'p' again.") + print("Running task, press 'p' to pause the task for manual operation of the browser such as entering the verification code; If you want to resume the execution of the task, please press 'p' again.") print("----------------------------------\n\n") # 使用监听器监听键盘输入 with Listener(on_press=on_press, on_release=on_release_creator(event)) as listener: diff --git a/ExecuteStage/easyspider_executestage.py b/ExecuteStage/easyspider_executestage.py index 3c26ee9..c1d2c1a 100644 --- a/ExecuteStage/easyspider_executestage.py +++ b/ExecuteStage/easyspider_executestage.py @@ -1514,8 +1514,12 @@ if __name__ == '__main__': print("Running task, press 'p' to pause the task for manual operation of the browser such as entering the verification code; If you want to resume the execution of the task, please press 'p' again.") print("----------------------------------\n\n") # 使用监听器监听键盘输入 - with Listener(on_press=on_press, on_release=on_release_creator(event)) as listener: - listener.join() + try: + with Listener(on_press=on_press, on_release=on_release_creator(event)) as listener: + listener.join() + except: + print("您的操作系统不支持暂停功能。") + print("Your operating system does not support the pause function.")