依靠python实现对Caps lock键的连点
为了保证电脑长期亮屏的需求,参考目前网上已有的脚本进行了简单的修改,代码部分包括了警告部分和输入密码部分,防止误触。
使用代码前需要安装模块pyautogui
pip install pyautogui
详细代码部分为:
print('This scrip is only use to study!' )
print('If you dont want your computer die!' )
print('Please click quickly upper right "X"')
a = input('If you still want to try please enter password:'+'\n')
print(a)
if a=='123':
print('Scrip is working now, you TAB will be control at next 5s!')
print('Your computer will twinkles for you!')
import pyautogui
import time
while True:
# 每隔5秒钟按下Capslock键
pyautogui.press('capslock')
time.sleep(5)