尝试使用 openpyxl 从 excel 中读取单元格时,会定期出现错误(zipfile.BadZipFile:文件不是 zip 文件)

问题描述 投票:0回答:0

def initialize_workbook(文件路径):

lock.acquire()

#workbook = load_workbook(file_path)

workbook = load_workbook(file_path, read_only=False, keep_links=False)

sheet = workbook['Clients']

return workbook, sheet

def read_cell(文件路径,行,列):

workbook, sheet = initialize_workbook(file_path)

value = sheet.cell(row=row, column=column).value

lock.release()

尝试使用 openpyxl 从 excel 中读取单元格时,会定期出现错误(zipfile.BadZipFile: File is not a zip file)。如何处理错误

python excel pandas database openpyxl
© www.soinside.com 2019 - 2024. All rights reserved.