I'm new to python and this is my script:
import arcpy,sys
input=sys.argv[1]
field=sys.argv[2]
try:
cursor=arcpy.da.SearchCursor(input,field)
getvalue=[row.getValue(field) for row in cursor]
values=set(getvalue)
print values
del cursor
except:
del cursor
When its trying to run cursor, the following error appeared:
Traceback (most recent call last):
File "C:\Users\Erfan\Desktop\Script2.py", line 6, in <module>
cursor=arcpy.da.SearchCursor(input,field)
RuntimeError: cannot open 'D:\gis\data\network'
By the way, I want to access a feature class inside a feature dataset in gdb.
row.getValue()
method applies to the oldarcpy
cursors, not to the (not so) newarcpy.da
cursors.