python如何用pynput监控按下空格实现这段程序的开关控制
# -*- coding: utf8 -*-from pyautogui import moveTo
import pyautogui
# currentMouseX, currentMouseY = position() # 鼠标当前位置
# print(currentMouseX, currentMouseY)
for i in range(4):
# 控制鼠标移动,duration为持续时间
moveTo(1387, 301, duration=0.25)# 移动到确定按钮
pyautogui.click(x=1387, y=301, clicks=1, button='left')#鼠标左键单击
moveTo(1709, 715, duration=0.25)# 移动到选课按钮
pyautogui.click(x=1709, y=715, clicks=1, button='left')#鼠标左键单击
moveTo(1023, 657, duration=0.25)# 移动到确定按钮
pyautogui.click(x=1709, y=715, clicks=1, button='left')#鼠标左键单击 你在做选课的按键精灵?
页:
[1]