fields = gp.listfields("[shapefile_location]") print fields
print [f.name for f in fields]
silverware = ["forks", "knives", "spoons"]
print [f.name for f in silverware]
>>> silverware = ["forks", "knives", "spoons"] >>> for utensil in silverware: ... print utensil ... forks knives spoons
print [f.name for f in silverware]