import arcpy
from arcpy import env
def sumOwners():
mxd=arcpy.mapping.MapDocument("CURRENT")
wrkPath=mxd.filePath[0: mxd.filePath.rfind('\\')]
env.workspace=wrkPath+"\\data.mdb"
Pclass=wrkPath+"\\data.mdb\\contamination\\parcel"
Rtable=wrkPath+"\\data.mdb\\owners2"
Prows=arcpy.UpdateCursor(Pclass)
Rrows=arcpy.SearchCursor(Rtable)
nameLst=[]
for i in Rrows:
nameLst.append([i.getValue("P_No"),i.getValue("Owner_Name")])
lst=[]
s=""
for i in Prows:
code=i.getValue("Code")
for j in nameLst:
if code==j[0]:
s+=j[1]+"\r"
s=s[:-1]
i.setValue("Owners", s)
Prows.updateRow(i)
s=""
Does anyone know how can i debug python scripts. The documentation of arcpy is so poor...