AnsweredAssumed Answered

errors

Question asked by gisnagy on Mar 21, 2020
Latest reply on Mar 21, 2020 by Davepike101@hotmail.com

i have found some errors but im sure not everything. what errors can you see in these?

import arcpy

from arcpy import env

env.workspace = "C:/EsriPress/Python/Data/Exercise07"

FC = "airports.shp" rows = arcpy.SearchCursor(fc)

fields = arcpy.ListFields(fc)

for field in fields:

if fields.name == "NAME"

for row in rows:

print "Name = {0}".format(row.getValue(field.name))

 

import arcpy

from arcpy import env

env.workspace = "C:/EsriPress/Python/Data\Exercise09"

raster = "landcover.tiff"

desc = arcpy.describe(raster)

x = desc.MeanCellHeight

y = desc.MeanCellWidth

spatialref = desc.spatialReference

units = spatialref.linearUnitName

print "Cells are" + str(x) + " by " + str(y) + " " + units + "."

Outcomes