Pthon 将Excel读入List中
Pthon 将Excel读入List中
# 读取并处理
def readFromExcel(file_path):
wb = openpyxl.load_workbook(file_path)
sheet_list = wb.sheetnames
ws = wb[sheet_list[0]]
total_list = []
for row in ws.rows:
row_list = []
for cell in row:
row_list.append(cell.value)
total_list.append(row_list)
# total_list = total_list[17:]
# 倒序输出
# total_list.reverse()
if checkModifyTime(): return
return total_list

浙公网安备 33010602011771号