Prashanna Guru Prashanna Guru - 1 month ago 14x
Python Question

Python module runs but shows "Syntax error while detecting tuple" in aptana

I am learning python and when I was running the below code


The code runs but shows the following syntax error

"Syntax error while detecting tuple"

How I can resolve it?


Aptana is set to use syntax checking for Python 2.x, where print is a statement. It is recognizing this as if you were trying to print a tuple, which is what that would be in Python 2.x, and correctly pointing out that you can't have an = sign inside the tuple. But the code is written for Python 3.x, where print is a function call and this syntax is valid.

You need to set Aptana to use the Python 3 grammar. I found this page that shows you how to set up Aptana to use a Python 3.x interpreter (which you probably already have, since the script runs) and syntax.