码迷,mamicode.com
首页 > 编程语言 > 详细

python excel写入 openpyxls

时间:2018-07-21 20:32:51      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:this   code   hello   内容   xlsx   book   ash   写入   his   

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"
  • 这种方法是不会覆盖的

python excel写入 openpyxls

标签:this   code   hello   内容   xlsx   book   ash   写入   his   

原文地址:https://www.cnblogs.com/wanderingfish/p/9347803.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!