import pyautogui
myScreenshot = pyautogui.screenshot()
myScreenshot.save(r'Path to save screenshotfile name.png')
import pyautogui
screenshot = pyautogui.screenshot()
screenshot.save("FilePathwhereyouwantToSaveFileName.FileFormat")
import pyautogui
im2 = pyautogui.screenshot('my_screenshot.png', region=(x,y, width, height))