Reportlab表索引错误

时间:2016-02-17 00:03:01

标签: python-3.x reportlab

我很困惑,因为我之前已经这样做但它已停止工作了。我得到一个索引错误,意味着我有4列和1行但是4行数据。

from reportlab.lib.pagesizes import letter
from reportlab.platypus import Table, SimpleDocTemplate
story = []

fielddata = ('DATE ',  '1', '2', '3')
colwidths = (40,  20,  20,  20)
rowheights = (20)
t = Table(fielddata, colwidths,  rowheights)
story.append(t)
doc = SimpleDocTemplate('scoreboard.pdf',pagesize = letter, topMargin=0)
doc.build(story)

0 个答案:

没有答案