import os
import datetime #定时发送,以及日期
import shutil #文件操作
import smtplib #邮件模块
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import Header
import time
import xlwt #excel写入
#写入EXCEL
def eWrite(fLocate,file_sheet,file_subject,style0):
try:
if os.path.exists(fLocate):
os.remove(fLocate) # 如果文件存在,则删除
f = xlwt.Workbook(encoding='utf-8') #打开excel文件
fs = f.add_sheet(file_sheet) #sheet名
subject = list(file_subject) #列表化
for i in range(len(subject)): #找到日期列
if '日期' in subject[i]:
col_num=i
for i in range(len(subject)): #sheet标题
fs.write(0, i, subject[i])
for i in range(10): #单元格宽度为
fs.col(i).width=3333
print("WRITE FINIS