xlwt写入Excel

# -*- coding:utf-8 -*-
#__author__ = "林深见鹿海蓝见鲸"
import xlwt ''' openexcel.add_sheet("sheet1")创建一个名称为sheet1的Excel表 sheet.write(0,0,"id"):第一行第一列写入数据
pycharm可能无法关联出write方法,直接敲就可以,不影响执行 openexcel.save(file_path):保存Excel
''' def Write_Excel(): openexcel = xlwt.Workbook(encoding="utf-8") sheet = openexcel.add_sheet("sheet1") sheet.write(0,0,"id") openexcel.save("C:\\Users\\xxx\\PycharmProjects\\pythonProject\\Excel\\sheet.xlsx") Write_Excel()

 

posted @ 2021-06-17 11:54  林深见鹿,海蓝见鲸  阅读(137)  评论(0)    收藏  举报