Answer the question
In order to leave comments, you need to log in
Why can't iterate through cellObj (openpyxl)?
You need to iterate over the sheet column and read certain data from the cells. The code has not reached the reading yet, since the cellObj object is non-iterable in my case. As I understand it, this is due to the fact that there are zero cells in the column, which are read as None. Here is the code that should run:
for cellObj in sheet['L']:
#if isinstance(cellObj, collections.abc.Iterable): - если раскомментировать эту строчку, то код , находящийся ниже её не выполнится. Если же её убрать, то вылетит ошибка
for cell in cellObj:
i = 1
while cell.value != 'МТГ':
i+=1
print(i)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question