ws = wb.active # 构建对应的 txt 文件路径 txt_file_path = os.path.splitext(xlsx_file_path)[0] + '.txt' with open(txt_file_path, 'w', encoding='utf-8') as txt_file: # 遍历工作表的每一行 for row in ws.iter_rows(values_only=