Parsing error in Python tool/ If & For statements

المشرف العام

Administrator
طاقم الإدارة
I have the following code in Python for a tool I want to build. For some reason I am getting a parsing error in line 23 that doesn't exist. Also when I am trying to define the output workspace every time the file I have created inside the Input folder is deleted. Why? I am using ArcGis 10.2.2

import arcpy, osfrom arcpy import envfrom arcpy.sa import *env.workspace = arcpy.GetParameterAsText(0)out = arcpy.GetParameterAsText(1)fc = arcpy.ListFeatureClasses("Pnt*", "Point")ras = arcpy.ListRasters("clip*", "GRID")point = Pntclip_pol1dem = clip_pol1i = 1for shp in fc: for raster in ras: if (shp == 'point' and raster == 'dem'): inRaster = raster inObserverFeatures = shp outViewshed = Viewshed(inRaster, inObserverFeatures, "") outViewshed.save(out + "view" + str(i)) point = "Pntclip_pol" + str(i) dem = "clippol" + str(i) i = int(i) + 1 else:

أكثر...
 
أعلى