5

Related to When are field calculator scripting questions on topic? and various comments on that Meta question (and many Main questions since) I think it is clear that we do not have consensus on where the line should be drawn between pure Python (better researched/asked at Stack Overflow) and Python functionality that is core to modern GIS (on-topic for here).

Where would you draw that line?

0

1 Answer 1

13

Another excellent example of why defining the line for 'pure' Python questions is going to be difficult: Using variable in SelectByAttribute_management.

At the lowest level possible, it is purely a Python syntax issue.

However, the error given would indicate an error outside of Python, within the ArcGIS API:

Runtime error Traceback (most recent call last): File "", line 1, in File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 6435, in SelectLayerByAttribute raise e ExecuteError: ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute).

If you look up this error message you'll find:

The SQL expression is invalid.

It takes knowledge of both ArcGIS and Python to understand what the problem is and what the solution should be.

Now, the question is, should I answer this? It's actually fairly simple, and I've already spent more time creating this answer than it would have taken to do that.
I could also vote to close it as off-topic. But, given the fact that I've already taken the time to read and understand the question, and I know a solution, am I really improving this community by voting to close this question?

At the very least, I believe trying to define what is 'pure' Python is going to be a moving target, and something this community will struggle with on an on-going basis.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .