我在列表中有数据,我想将列表写入 excel 中的特定列。我有 list = [Apple, Pear, Fruit] 我需要把它写成 Column A = Apple,Column C = Pear,Column F = Fruit。当我使用追加时,它正在写入 A、B 和 C 列。但这不是我想要的。
这是我的代码:
import openpyxl
path = r"C:\Folder\Filename.xlsx"
wb = load_workbook(path)
sheet = wb[sheet_name]
list = [Apple, Pear, Fruit]
sheet.append(list)