Last active
August 29, 2015 13:56
-
-
Save knu2xs/8948022 to your computer and use it in GitHub Desktop.
list comprehension to collect all attribute field names in a variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get parameter | |
feature_class = arcpy.getParameterAsText(0) | |
# use list comprehension to list all field objects and access the name of the field | |
attribute_names = [field.name for field in arcpy.ListFields(feature_class)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment