79407545

Date: 2025-02-02 23:50:24
Score: 2
Natty:
Report link

Figured it out, hope this helps anyone in the future who may have the same issues.

def logger():
    logging.basicConfig(level=logging.INFO, filename="bandit.log", filemode="w", format="%(asctime)s - %(levelname)s - %(message)s")
    logger = logging.getLogger(__name__)
    logger.propagate = False

    handler = logging.FileHandler('anomaly.log')
    formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
    handler.setFormatter(formatter)

    logger.addHandler(handler)
    try:
        location = pyautogui.locateOnScreen('1.png', confidence=0.9)
        if pyautogui.locateOnScreen('1.png', confidence=0.9):
            global call_count
            call_count += 1
            logger.info(call_count)
    except pyautogui.ImageNotFoundException:
        pass
Reasons:
  • Whitelisted phrase (-1): hope this helps
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): have the same issue
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: D3AD_SHOT