新建空白word:
import docx,os
#以默认模板建立文档对象
doc = docx.Document()
for i in range(16):
doc.save('E:/课程学习/第%s周.docx' %(i+1))
新建空白excel:
#创建空白excel
import xlwt
import xlsxwriter
for h in range(4):
for i in range(12):
for j in range(10):
xls = xlsxwriter.Workbook(r'E:train_data\mood_%s\data_%s_%s_%s.xlsx' %(h+1,i+1,h+1, j+1))
xls.close()