pyscreenshot and screeninfo modules
- Install
pyscreenshot
andscreeninfo
modules from the command line:
pip install Pillow
pip install pyscreenshot
pip install screeninfo
Note: Pillow
library required by pyscreenshot
.
- Take a screenshot of each monitor individually:
from screeninfo import get_monitors
import pyscreenshot
for i, monitor in enumerate(get_monitors()):
x1 = monitor.x
y1 = monitor.y
x2 = monitor.x + monitor.width
y2 = monitor.y + monitor.height
image = pyscreenshot.grab(bbox=(x1, y1, x2, y2))
image.save('screenshot_' + str(i) + '.png')
Leave a Comment
Cancel reply