import time
import os
import schedule
import pyautogui
def Rec():
record = os.startfile("C:\Program Files (x86)\EVCapture\EVCapture.exe")
schedule.every().day.at("16:40").do(Rec)
while True:
if pyautogui.hotkey('ctrl', 'f2'):
break
schedule.run_pending()
time.sleep(1)
def Star_t():
St = pyautogui.hotkey('ctrl', 'f1')
Star_t()
你无限循环时,里面的参数会发生变化,那么你可以通过判断参数的属性,来执行break语句。即:
if ……:
break
count = 0while b==2: count += 1 if count >= 10000: break ...