背景:获取excel表格最后一列值时报错,IndexError: tuple index out of range
诉求:因为excel表格是可维护的,要求在更改后的excel中也能获取最后一列的值。要求提供正确的代码片段
def get_Product_Category_value():
y_3_data_Product_Category = []
for i in range(8, 36):
cell = ws[ws.max_column][i]
y_3_data_Product_Category.append(cell.value)
return y_3_data_Product_Category
print(get_Product_Category_value())