Advertisement
FlyFar

Screenshot.py

Aug 10th, 2023
829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | Cybersecurity | 0 0
  1. from PIL import ImageGrab
  2. from os import system, path
  3. from Configuration import Configuration
  4.  
  5.  
  6. class Screenshot():
  7.  
  8.     def __init__(self, config: Configuration):
  9.         self.__config = config
  10.         self.__screenshotCounter = 0
  11.  
  12.  
  13.  
  14.     def takeScreenshot(self) -> None:
  15.         pic = ImageGrab.grab()
  16.         self.__screenshotCounter += 1
  17.         pic.save(self.__config.screenshotPath + f'\\{self.__screenshotCounter}.jpg')
  18.         if self.__config.debug:
  19.             print(f'Screenshot-{self.__screenshotCounter} taken')
Tags: screenshot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement