Search code examples
pythonscreen-capture

How I can develop a screen-capture tool in Python


I'm learning Python now and I want to develop a screen capture tool in Python.How I can do this work?


Solution

  • If you're on windows, use ImageGrab module along with Imaging library.
    Something like:

    from PIL import ImageGrab
    ImageGrab.grab().save("screenshot.jpg", "JPEG")