I am running this extremely simple code using the ArcGIS python environment:
import arcpy test = r"C:\....\New_Shapefile.shp" #test contains several fields, including one called "Number". updaterows = arcpy.SearchCursor(test) for row in updaterows: print (row.getValue("Number"))
the first time I run the code, it works and I get a list of all the elements in the column "Number", but if I try to run the for loop again, when I enter the code I do not receive any output. This does not change nor if I type the code again or if I simply recall it from the command history. Also, I tried to replace the field "Number" with some other field name, and it still does not print if already a print command was run before. It seems to work only if I delete "updaterows" first. What does this occur? Is the problem involved with the function or with the arcGIS development environment for python?