import arcpy with arcpy.da.SearchCursor( 'C:/Temp/foo.shp' , [ "*" ] ) as cursor: for row in cursor: print row[0]
import arcpy def main(): fc = r"C:\TestData\500ft_Grid.shp" fields = ["*"] with arcpy.da.SearchCursor(fc, fields) as cursor: for row in cursor: print(row) if __name__ == '__main__': main()
fc = r"C:\TestData\500ft_Grid.shp" fields = ["*"] with arcpy.da.SearchCursor(fc, fields) as cursor: for row in cursor: print(row)
Bug BUG-000083762: In each cursor documentation, specify the type of lock being closed and released, as a shared lock is still present in the geodatabase after the 'with' statement executes.