Skip to content Skip to sidebar Skip to footer

Python Gives Syntax Error But There Is No Mistake?

Can someone say why python doesn't allow this? # -*- coding: utf-8 -* import win32api,win32con,os,time,sys x_pad =464 y_pad =235 def tik(): win32api.mouse_event(win32con.MOUSE

Solution 1:

Look at the code immediately above the reported error:

defmousePos(cord):
    win32api.SetCursorPos((x_pad + cord[0], y_pad + cord[1])

You're missing a closing parentheses.

Solution 2:

You sure there's no syntax error?

win32api.SetCursorPos((x_pad + cord[0], y_pad + cord[1])
                     1221???

The line that a syntax error is reported on is not necessary where the syntax error is. It's merely the first place where an earlier syntax error caused the parser to realize that something's wrong.

Post a Comment for "Python Gives Syntax Error But There Is No Mistake?"