I want to read data from an .ods
file (using ezodf
), and convert it to JSON.
Here is my code:
try:
while conf[i, 2].value != None:
export_data['priorities'][conf[i, 2].value] = str(int(conf[i, 3].value))
i+=1
except IndexError:
print("This probably has a better solution.");
conf[x, y]
references a cell in the conf
sheet. As you can see I want to read the values of column i
as long as there isn't empty cell in it.
The problem is that the first empty cell is raising an IndexError
exception.
Can I fix this in a simple way, for example, check the length of this column?