with arcpy.da.SearchCursor(fc, ("GLOBALID@")) as cursor: print("Current GLOBALID is {0}".format(row[0]))
Oops, should have said getCount returns an object that is converted to string w/ getOutput and in the sample, the necessary part of the string (which is the count only), is converted to integer. Sorry for any confusion.
EDIT: Also, I question (1) your use of the print statement and (2) if you have to convert the return value to string. Such as:print str(row.getValue("fieldname"))I thought it an interesting additional note that some py functions return strings and may need to be converted to be useful -- e.g., apparently returning results on getCount is string and in the following sample online it is made an integer for further use (a little counterintuitive):(see section Getting results from a tool)http://resources.arcgis.com/en/help/main/10.1/index.html#//002z0000000n000000
I believe you have to quote the field - for example if you actually have a field by the name, fieldname:row.getValue("fieldname")(unless of course fieldname is a variable representing text, as in:fieldname = "fieldname"
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.