Python - 解析错误SyntaxError:语法无效

时间:2016-04-06 15:40:05

标签: python syntax-error arcgis arcmap

我无法弄清楚下面第9行语法的错误。救命?在ArcMap中使用Python。

>>> for strName in rasterList:
...     pRaster = arcpy.Raster(strName)
...     pPoint = arcpy.Point(2256560.829028871, 908394.8188188977)
...     if pRaster.name == "dem":
...         myArray = arcpy.RasterToNumPyArray(pRaster, pPoint, 3, 3)
...         (width, height)= myArray.shape
...         for row in range(0,height):
...             for col in range(0,width):
...                 print "["+ str(row) + ", " + str(col)+"]:"str(myArray.item(row,col))
...                 
Parsing error SyntaxError: invalid syntax (line 9)

1 个答案:

答案 0 :(得分:1)

您错过print "["+ str(row) + ", " + str(col)+"]:"str(myArray.item(row,col))

之间的+