VOOZH about

URL: https://www.geeksforgeeks.org/python/how-to-take-screenshots-using-python/

⇱ How to take screenshots using python? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to take screenshots using python?

Last Updated : 18 Mar, 2024

Python is a widely used general-purpose language. It allows performing a variety of tasks. One of them can be taking a screenshot. It provides a module named

pyautogui

which can be used to take the screenshot.

pyautogui

takes pictures as a PIL(python image library) which supports opening, manipulating, and saving many different image file formats.

Modules needed

  • Pillow: To install Pillow type the below command in the terminal.
    pip install Pillow
    
  • pyautogui: To install pyautogui type the below command in the terminal.
    pip install pyautogui
    
    

Below is the implementation.

Output:

👁 python-screenshot
Comment