Apr-04-2024, 07:47 AM
(This post was last modified: Apr-04-2024, 08:31 AM by Gribouillis.)
(Mar-11-2024, 12:21 AM)deanhystad Wrote: # is the start of a line comment in Python. Everything following # in the line is a comment. Don't depend on syntax highlighting.
The error message told you where the error happened.
Note the lack of a comment character in
Error:Traceback (most recent call last): File "D:/ArcPy_Ex/test.py", line 5, in <module> outfc = arcpy.GetParameterAsText(1) NameError: name 'arcpy' is not definedoutfc = arcpy.GetParameterAsText(1)
That right. To resolve this problem and see the code correctly in the Python IDLE editor, you need to ensure that the comments are properly formatted with a single '#' symbol at the beginning of each comment line.
«spam link removed»