本文共 509 字,大约阅读时间需要 1 分钟。
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
R2提到,可以同时发送HTML和Plain,通过msg=MIMEMultipart('alternative')
实现。
使用此模块添加html
table之后,会覆盖plain
文本,导致上述方案无效。
可以将plain
文本格式也改成html
。
转载地址:http://stge.baihongyu.com/