Python script working incorrectly

المشرف العام

Administrator
طاقم الإدارة
  • i am writing script which uses different Tools of arcgis and implementing different functionalities ..
  • My script consists in different Functions running in an order.Each function is connected to each other , and works on layers and performs functions like(update cursor, search cursor )
  • When function1 finishes execution funciton2 starts and works on the same layer on which first one was working.
The problem is here function2 generates wrong results or works wrong.

works wrong means if a loop is defined to 5 iterations it will runs more then 5 times. like 20, 30 times and generates different results of one value.

When i run each function separately it will works fine. but when i run function in one script it will create problems.

My findings of this are LOCKS which are creating the problem.

Sample Structure of my script:

import arcpy import math import sys import traceback from arcpy import env class test: def __init__(self, workSpace): self.workSpace = workSpace # Add Fields def function1(self): # Script return; # Generate Report def function2(self): # Script return; t = test(workSpace) t.function1() t2 = test(workSpace) t2.function2() NOTE: code is tested and working correct there are no problem in code



أكثر...
 
أعلى