[問題] LINE notify多螢幕截圖

看板Python作者 (My Heart)時間2年前 (2023/02/01 09:23), 編輯推噓0(004)
留言4則, 2人參與, 2年前最新討論串1/1
HI 各位早安, 小弟是新手,目前正在學習python,透過網站上面的教學有成功使用Line 推播截圖 我螢幕的視窗都有成功傳到指定的對象,但我想知道如果我今天有2-6個螢幕 (筆電HDMI輸出或桌機外顯有8 HDMI ports)我是否能透過pyautogui將這個每個螢幕的視窗 都截出來?,另外這個模組是否可以截部分大小? 以下是我的程式碼 import pyautogui import requests import time def screenshot(): myScreenshot = pyautogui.screenshot() myScreenshot.save('./test.png') def sendLineNotify(msg): url = 'https://notify-api.line.me/api/notify' token = 'token' headers = { 'Authorization': 'Bearer ' + token } data = { 'message':msg } image = open('./test.png', 'rb') imageFile = {'imageFile' : image} data = requests.post(url, headers=headers, data=data, files=imageFile) for i in range(5): screenshot() time.sleep(5) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.163.62.214 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1675214622.A.2F3.html

02/01 12:05, 2年前 , 1F
如果是win32, PIL.ImageGrab.grab本身支援多螢幕截圖
02/01 12:05, 1F

02/01 23:55, 2年前 , 2F
Win32 API 可以針對 windows hanlder 截圖
02/01 23:55, 2F

02/01 23:57, 2年前 , 3F

02/02 00:12, 2年前 , 4F
02/02 00:12, 4F
文章代碼(AID): #1ZsRyUBp (Python)
文章代碼(AID): #1ZsRyUBp (Python)