1234567891011121314151617181920212223242526272829 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @Contact : liuyuqi.gov@msn.cn
- @Time : 2022/10/05 05:44:28
- @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
- @Desc : 登录界面自动化输入密码,权限有问题,弃用
- '''
- from ctypes import *
- import time
- # while True:
- # u = windll.LoadLibrary('user32.dll')
- # result = u.GetForegroundWindow()
- # print(result) # 0则表示锁屏
- # time.sleep(2)
- import pyautogui
- pyautogui.FAILSAFE=False
- time.sleep(5)
- pyautogui.press('enter') # enter to login.
- #pyautogui.click(1025,513, 2) # click to show the password box
- time.sleep(1)
- pyautogui.typewrite("Asdfghjkl;'",2) # Type the password
- pyautogui.press('enter') # enter to login.
- time.sleep(2)
|