I have a shapefile from which I want to retrieve the last row values for specific fields to use them as input in a tool. So far this is what I have which does not work.
length=int(arcpy.GetCount_management(shapefile).getOutput(0))
print length
cursor=arcpy.SearchCursor(shapefile)
for row in cursor:
row= row[length-1]
endx= row.getValue("LastX")
endy= row.getValue("LastY")
sourcePoint= arcpy.Point(endx, endy)