
Good afternoon.
I'm having an issue with my code where every time the fifth photo is being saved, it's named as number 4, causing a problem with saving since it's considered as a duplicate name. I've tried to fix it with the help of ChatGPT and Copilot, but the error persists.
The code:
I'm having an issue with my code where every time the fifth photo is being saved, it's named as number 4, causing a problem with saving since it's considered as a duplicate name. I've tried to fix it with the help of ChatGPT and Copilot, but the error persists.
The code:
import pyautogui import time import keyboard pyautogui.PAUSE = 0.2 def check_for_b(): return keyboard.is_pressed('b') time.sleep(4) numero_foto = 1 while True: pyautogui.rightClick(x=718, y=499) pyautogui.click(x=845, y=559) pyautogui.click(x=112, y=328) pyautogui.doubleClick(x=706, y=223) pyautogui.click(x=579, y=466) pyautogui.write(f"foto_{numero_foto}") pyautogui.press("enter") pyautogui.click(x=751, y=556) pyautogui.press("right") if not check_for_b(): numero_foto += 1 else: break