I have a list of integers and a QTableWidget populated with 33 rows.
My list is like this (which corresponds to the rows in the QTableWidget):
my_list = [15, 14, 1, 2, 1]
I would like to extract information from the table by the number of rows.
For example, I want to loop through the table for the first 15 rows, then the next 14 rows, then the next 1 row etc. So at the moment, I'm using:
my_list = [15, 14, 1, 2, 1]
for row in range(15):
# Do something
for row in range(15,29)
# Do something
for row in range(29,30)
# Do something
...
As the values in the list (and the number of items) can change, what is the most efficient way of doing this?