xlsx_file = "test.xlsx"
wb = openpyxl.Workbook(xlsx_file)
ws = wb.active
ws["A1"]="hello world"
ws["A2"]="this is test"
  • 上种方法 写入文件,会覆盖打开前的内容
xlsx_file = "test.xlsx"
wb = openpyxl.load_workbook(xlsx_file)
ws = wb.active
ws["A1"]="hello world"
ws["A2"]="this is test"
  • 这种方法是不会覆盖的

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-02-09
  • 2022-01-16
  • 2021-09-18
  • 2021-11-23
猜你喜欢
  • 2021-12-22
  • 2021-09-09
  • 2022-12-23
  • 2022-02-06
  • 2021-11-02
  • 2021-11-07
相关资源
相似解决方案