Python - How To Print Screen Windows Using Python Pyautogui Module

Опубликовано: 05 Апрель 2025
на канале: Computertechlighthouse
63
1

Hi, in this video we will learn how to Print screen using python (pyautogui module) and few modification.

PyAutoGUI is cross-platform mouse and keyboard control and a simple API.

Below the final code:
import pyautogui
import time
n = 0
time.sleep(5)
while 1:
n = n + 1
myscreenshot = pyautogui.screenshot()
myscreenshot.save(r'C:\Users\Totzfreelance\Pictures\screenshot'+str(n)+'.png')