# Mac OS系统:需要先安装pyobjc模块,最后安装pyautogui # pip install pyobjc-core # pip install pyobjc # pip install pyautogui import pyautogui #按键组合alt+tab pyautogui.hotkey('alt','tab',interval=2)
# pip install pyautogui import pyautogui import time while True: pyautogui.press('volumedown') time.sleep(1) pyautogui.press('volumeup') time.sleep(5)