将DataFrame作为邮件正文HTML发送 in Python
发布日期:2021-05-07 14:24:33 浏览次数:8 分类:原创文章

本文共 509 字,大约阅读时间需要 1 分钟。

  • Overview

    To convert this question into english, maybe:

    How to convert a DataFrame into a petty HTML table and send it over Email, like this one .

    From R1,there is a module named pretty_html_table .

  • The objective of this package is to convert a pandas dataframe into a pretty html table.

    As of now, 10 colors are available.

  • 其他方案

    通过df.to_html(), 参见R3

  • 延展问题:同时发送HTML和Plain格式的Email

    R2提到,可以同时发送HTML和Plain,通过msg=MIMEMultipart('alternative')实现。

    使用此模块添加html table之后,会覆盖plain文本,导致上述方案无效。

    可以将plain文本格式也改成html

  • References

上一篇:理解Library of Congress Cataloging-in-Publication Data
下一篇:理解Raft日志||Paxos

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年03月20日 19时35分49秒