亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

【金秋打卡】第24天+Python辦公自動化

標簽:
Python
  • 文章标题:【金秋打卡】第24天+Python办公自动化

  • 第一模块: 学习课程名称:Python办公自动化;章节名称(序号): 4-6综合实战:某培训机构就业数据分析(二);讲师姓名:离岛

  • 第二模块: 课程内容(内容概述):

        综合实战:需求分析

        1.Xlrd模块读取Excel数据;

        2.xlsxwriter模块生成就业数据图表

        3.smtplib模块发送附件邮件

            (1)smtplib模块对smtp协议进行了封装,提供更便捷的方式发送电子邮件;

            (2)发送邮件——>登录(服务器设置)、写邮件(信息发送给方、信息接收方、邮件主题、邮件内容-附件)、发送;


主要学习了如何发送邮件;
  • 第三模块: 最终的解决思路

    https://img1.sycdn.imooc.com//6375a7250001690a11290943.jpg

xlrd
xlsxwriter
smtplib
form email.mime.text MIMEText form email.mime.multipart MIMEMultipart
form email.mime.application MIMEApplication

date=xlrd.open_workbook()
classinfo=[]
sheet date.sheets():
    dict={:sheet.name,:}sum=i (sheet.nrows):
        i>:
          sum+=(sheet.cell(i,).value)dict[]=sum/(sheet.nrows-)
    classinfo.append(dict)
(classinfo)

workbook=Xlsxwriter.workbook()
sheet=workbook.add_worksheet()nameinfo=[]
salaryinfo=[]
item classinfo:
    nameinfo.append(item[])
    salaryinfo.append(item[])
sheet.write_column(,nameinfo)
sheet.write_column(,salaryinfo)
chart=workbook.add_chart({:})
chart=set_title(:’‘)
chart.add_series({
    :,
    :,
    :})
sheet.insert_chart(,chart)
workbook.close()
host_server=sender=code=user1=mail_title=“”
mail_content=attachment=MIMEApplication((,).read())
attachment.add_header(,,=)

smtp=smtplib.SMTP(host_server)
smtp=login(sender,code)
msg=MIMEMultipart()msg[]=mail_title
msg[]=sender
msg[]=user1
msg.attch(MIMEText(mail_content))
msg.attach(attachment)
smtp.sendmail(sender,user1,msg.as_string())




點擊查看更多內容
1人點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消