I'm working with python 2.7 (quite a beginner). I have a list, and I have a feature class with :
A = a field that contains values that I would like to use as the start of the slicing
B= a field that contains values indicating the number of items I need to take into my slicing.
Actually, I would like to do something like this :
list = [1,2,3,4,5,6,7,8,9,10,11,12] rows = ap.SearchCursor(fc, fields = "A; B") for row in rows: a = row.getValue("A") b = row.getValue ("B") newlist= list[a: (a+b)]
But its not working, I got an error "slice indices must be integers or None or have an index method"