Showing syntax error and I cannot make out what is going wrong with the while loop. Can anyone please see to this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Showing syntax error and I cannot make out what is going wrong with the while loop. Can anyone please see to this?

from pyautogui import * import pyautogui import time import keyboard import random import win32api, win32con #X: 377 Y: 636 RGB: (157, 162, 231) #X: 466 Y: 636 RGB: (155, 161, 230) #X: 554 Y: 636 RGB: (253, 18, 1) #X: 629 Y: 636 RGB: (168, 172, 232) def click(x,y): win32api.SetCursorPos((x,y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0) time.sleep(0.01) win32api.mouse(event(win32con.MOUSEEVENTF_LEFTUP,0,0) while keyboard.is_pressed('q') == False: #Syntax error in this line if pyautogui.pixel(377,636)[0] == 0: click(377,636) if pyautogui.pixel(466,636)[0] == 0: click(466,636) if pyautogui.pixel(554,636)[0] == 0: click(554,636) if pyautogui.pixel(629,636)[0] == 0: click(629,636)

11th Nov 2020, 2:49 PM
Ayush Dubey
Ayush Dubey - avatar
1 Answer
+ 5
Missing parenthesis at the end of a line before a while loop
11th Nov 2020, 3:16 PM
Vitaly Sokol
Vitaly Sokol - avatar