Marimbe Tapiwa
Marimbe Tapiwa

Reputation: 1

Multiple screen shots not working in Python

Python screenshot not working in IDE python 2.7.14. Not sure what I am missing in the code below:

    import pyautogui, time  
    x=l 
    img = pyautogui.screenshot()  
    while x < 4 :
        img.save("‪C:/Users/ABC/OneDrive/Desktop/Screenshots"+str(x)+".png")    
        x=+1       
        time.sleep(2)

Upvotes: 0

Views: 669

Answers (1)

Mehran Jalili
Mehran Jalili

Reputation: 705

import pyautogui
import time

x = 1
while x < 4:
    img = pyautogui.screenshot()
    img.save("‪C:/Users/ABC/OneDrive/Desktop/Screenshots"+str(x)+".png")
    x += 1
    time.sleep(2)

Upvotes: 1

Related Questions