编程语言
首页 > 编程语言> > python 发送快捷键

python 发送快捷键

作者:互联网

  1. mac发送视频全屏命令
# Mac OS系统:需要先安装pyobjc模块,最后安装pyautogui
# pip install pyobjc-core
# pip install pyobjc
# pip install pyautogui

import pyautogui
#按键组合alt+tab
pyautogui.hotkey('alt','tab',interval=2)

  1. windows永远不进入睡眠
# pip install pyautogui

import pyautogui
import time

while True:
    pyautogui.press('volumedown')
    time.sleep(1)
    pyautogui.press('volumeup')
    time.sleep(5)

标签:pyautogui,python,快捷键,发送,pyobjc,install,time,pip,import
来源: https://www.cnblogs.com/amize/p/14940651.html