Screenshot of tkinter python working window


How do I take a screenshot of the workspace that was generated using the tkinter library?


pip3 install pyscreenshot

from pyscreenshot import grab

im = grab(bbox=(100, 200, 300, 400))

pip3 install pillow

from PIL import ImageGrab
snapshot = ImageGrab.grab()
save_path = "your/save/path"

pip3 install pyautogui

import pyautogui
screenshot = pyautogui.screenshot('path/to/file.png')
Scroll to Top