-1

I want to save the multiple screenshots at a time using the tkinter in python but i am unable to append the image files into the folder. Please tell how to do this.

def takeScreenshot ():
    x = 1
    while x < 4:
        img = pyautogui.screenshot()
        img.save("‪C:\Shivanshi\image\screenshot"+str(x)+".png")
        x += 1
        time.sleep(2)

1 Answers1

0

If the problem is regarding the location. change the path to

r"‪C:\Shivanshi\image\screenshot"+str(x)+".png"

or

"‪C:/Shivanshi/image/screenshot"+str(x)+".png"
Aman Neo
  • 223
  • 2
  • 7