There are quite a few questions like this one, but none of them seem to be both cross-platform and specifically for Python 3, and I'm struggling to find a reliable solution.
How can I take a cross-platform screenshot in Python 3?
My current solution has been to use the ImageGrab
function from the PIL library, like so:
from PIL import ImageGrab
image = ImageGrab.grab()