[Answered ]-While loop incrementing range in django

1๐Ÿ‘

โœ…

You can use get_addr_int(row, col) function which will output a string label for your cell, see the docs here: https://gspread.readthedocs.org/en/latest/#gspread.Worksheet.get_addr_int

If I get our code right in your case it will be something like:

col_index=1
i=0
while i<4:
    start_cell = worksheetworksheet.get_addr_int(10, col_index)
    end_cell = worksheetworksheet.get_addr_int(20, col_index+2)
    cell_values_list=worksheetworksheet.range('%s:%s' % (start_cell, end_cell))
    ...
    ...
    col_index=col_index+3
    i=i+1
๐Ÿ‘คNhor

1๐Ÿ‘

for i in xrange(65, 78, 3): # character ord form A to N
    range_str = "%s10:%s10"%(chr(i), chr(i+2))
    worksheetworksheet.range(range_str)        
๐Ÿ‘คHasan Ramezani

Leave a comment