def save_data(item, sheet): """ 数据保存 :param item: 数据 :param sheet: sheet名 :return: """ dfscores = pd.DataFrame(item) # 写入数据 encoding="utf-8-sig" 看情况而用哦 writer = pd.ExcelWriter("./Tender.xlsx", encoding="utf-8-sig") dfscores.to_excel(writer, sheet) writer.save()