while 1:
x=+1
pic = pyautogui.screenshot()
pic.save(str(x)+".png", "PNG")
print(x)
time.sleep(5)
X won't increase every time the loop, loops
I want the screenshot to save under a different name every time it screenshots, so I put x=+1 to constantly give a new name for the screen shot to save under but it only stays at one.
You should write
x += 1which meansx = x + 1.Here you just value the
xto+1(x = +1)A little advice: is better to write mathematical syntax with space to don't get problems like this.