0

My ArcPy script doesn't run because a syntax error was raised, but I already had checked the syntax and indentation of the entire script.

Can anyone help me?

The error that was raised points to a colon that's the end of 'if' on the line 236 as you see in the print screen below.

enter image description here

closed as off-topic by Vince, tinlyx, mgri, Oto Kaláb, nmtoken Sep 13 '17 at 9:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – Vince, tinlyx, mgri, Oto Kaláb
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    No it's because you're missing a closing bracket on the preceding line. count = Int(arcpy.get... .getOutput(0) **)** Please don't post your whole code when asking a question, it's really hard to find the line with an error; if you use a good python editor you can check for these types of syntax errors fairly quickly. – Michael Stimson Sep 13 '17 at 3:27
  • I agree with @MichaelStimson on both counts - please try to always present a code snippet rather than code. – PolyGeo Sep 13 '17 at 3:32
  • That's it! Thanks! Now, how do I close or mark as answered this question? – Pedro Sep 13 '17 at 4:15
3

Unclosed parentheses just above the error line:

count = int(arcpy.GetCount_management('copyFC_lyr').getOutput(0)

Should be:

count = int(arcpy.GetCount_management('copyFC_lyr').getOutput(0))

Not the answer you're looking for? Browse other questions tagged or ask your own question.