'''
Author: Liang
LastEditors: Liang
Date: 2020-12-11 14:56:14
LastEditTime: 2020-12-12 18:30:20
Email: str-liang@outlook.com
FilePath: /测试练习c:/Users/Administrator/Desktop/中午听课-自动打开相关应用 - 副本.py
Environment: Win 10 Python 3.8
Description:
懒得手动每天点复制粘贴了,所以这个用于每天帆软报表截图发送到微信
1、点网页的各个子页面;
2、截图,切换应用;
3、粘贴,再次切换应用。
'''
import pyautogui as auto
from time import sleep
from tkinter.messagebox import showinfo
# 默认参数 设置y=18,可以不传参
def photo_Presc(x,y=18):
auto.moveTo(x,y);sleep(0.2)
auto.click();sleep(3)
auto.press('PrtSc');sleep(0.5)
auto.hotkey('alt','tab');sleep(0.2)
auto.hotkey('ctrl','v');sleep(0.3)
auto.press('Enter');sleep(0.3)
auto.hotkey('alt','tab');sleep(0.2)
if __name__ == "__main__":
showinfo('Wait','Hold on Please')
sleep(3.5) # 延迟,等待打开浏览器
photo_Presc(89)
photo_Presc(336)
photo_Presc(538)
photo_Presc(1198)
photo_Presc(1500)
photo_Presc(1750)