I am learning python from a book, programming python with arcgis 10.1
I did everything from Chapter 7 but I have a mistake.
Here is the code
import arcpy, os<BR />try:<BR /> outputFC = arcpy.GetParameterAsText(0)<BR />fClassTemplate = arcpy.GetParameterAsText(1)<BR /> f = open(arcpy.GetParameterAsText(2),'r')<BR /> arcpy.CreateFeatureclass_management(os.path.split(outputFC)<BR />[0], os.path.split(outputFC[1]), "point", fClassTemplate)<BR /> lstFires = f.readlines()<BR /> cur = arcpy.InsertCursor(outputFC)<BR /> cntr = 1<BR /> for fire in lstFires:<BR /> if 'Latitude' in fire:<BR /> continue<BR /> vals = fire.split(",")<BR /> latitude = float(vals[0])<BR /> longitude = float(vals[1])<BR /> confid = int(vals[2])<BR /> pnt = arcpy.Point(longitude, latitude)<BR /> feat = cur.newRow()<BR /> feat.shape = pnt<BR /> feat.setValue("CONFIDENCEVALUE", confid)<BR /> cur.insertRow(feat)<BR /> arcpy.AddMessage("Record number: " + str(cntr) + " written to <BR />feature class")<BR /> cntr = cntr + 1<BR />except:<BR /> print arcpy.GetMessages()<BR />finally:<BR /> del cur<BR /> f.close()
But when I run the Code I get mistake which connect del cur.
And I do not understand why I get this mistake.