I have seen this answer to Calling specific columns of attribute table using ArcPy?, but it uses a slice to select columns.
I would like to select them using a list.
Example code that doesn't work:
import arcpy
select_cols = ['FID', 'Shape', 'OBJECTID'] # the list of columns
for field in field_list[select_cols]:
print(field.name)
Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers or slices, not list
A different attempt
field_list2 = field_list[select_cols]
Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers or slices, not list