with open("example.csv") as of:
for row in data:
for cell in row:
of.write(cell + ";")
of.write("\n")
我想你也可以写一个html表格文件,然后用css来设置它的样式。
with open("example.html") as of:
of.write("<html><table>")
for index, row in enumerate(data):
if index == 0:
of.write("<th>")
else:
of.write("<tr>")
for cell in row:
of.write("<td>" + cell + "</td>")
if index == 0:
of.write("</th>")
else:
of.write("</tr>")
of.write("</table></html>")
感觉像是http://matplotlib.org/的工作,就像https://stackoverflow.com/a/8976359/447599。
也可以是ReportLab的工作,如Python reportlab inserting image into table
另一个选项是根据http://en.wikibooks.org/wiki/LaTeX/Tables以表格形式输出乳胶源
如果这不适合您,只需编写.csv文件并在excel中格式化表格,然后在那里导出图像表单,代码如下
我想你也可以写一个html表格文件,然后用css来设置它的样式。
相关问题 更多 >
编程相关推荐