The .next() statement (in addition to the for loop) is unneccessary. I think a bit cleaner code would look like:import arcpy
myOutputFile = open('C:\\temp\\myoutputfile.txt', 'w')
rows = ap.SearchCursor('C:\\temp\\myInputTable.shp')
for row in rows:
myOutputFile.write(str(row.APN) + '\n')
del row, rows
myOutputFile.close()
Also, in v10.1 syntax using the .da cursors (~30x faster than the old search cursors):import arcpy
myOutputFile = open('C:\\temp\\myoutputfile.txt', 'w')
rows = arcpy.da.SearchCursor('C:\\temp\\myInputTable.shp',["APN"])
for row in rows:
myOutputFile.write(str(row[0]) + '\n')
del row, rows
myOutputFile.close()