Take Screenshot of Each Monitor Individually using Python

pyscreenshot and screeninfo modules

  1. Install pyscreenshot and screeninfo modules from the command line:
pip install Pillow
pip install pyscreenshot
pip install screeninfo

Note: Pillow library required by pyscreenshot.

  1. 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

Your email address will not be published.