# -*- 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()