由python获取的数据,可以通过保存到html中展示,借助css样式,实现更加直观好看的效果。
1. html模板
2.数据替换
html = """<!DOCTYPE html>
<html lang="en">
<head>title</head>
<body>
<table border='1'>
<thead>
<tr>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr>%s</tr>
</tbody>
</body>
</html>"""
tr = "Just for test"
f = open('temp.html','w')
f.write(html%tr)
f.close()
从list中读取数据并填充到html 変量中
html = """<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>
<table border='1'>
<thead>
<tr>
<th>Date</th