【发布时间】:2015-10-28 21:23:54
【问题描述】:
这是我的第一篇 StackOverflow 帖子,如果我犯了任何标记错误或类似的事情,我想向您道歉。
这是我目前正在进行的项目: 我正在开发一个 Django Web 应用程序,它负责根据用户的动态输入生成审计报告。用户可以选择引用文件的变体。
我目前面临的问题如下:
我想生成列表中给定的静态元素的子弹列表。 这是我目前的代码。
def generateList(list_of_bullets):
styles = getSampleStyleSheet()
t1 = ListFlowable([
for element in list_of_bullets:
ListItem(Paragraph(element, styles['Normal']), bulletColor=CMYKColor(0.81,0.45,0.53,0.23), value='circle')
)], bulletType='bullet', start='circle')
story.append(t1)
PyCharm 报告 ListFlowable([
下面的代码运行良好
def get_bullet_list():
styles = getSampleStyleSheet()
t1 = ListFlowable([ListItem(Paragraph("Sample Text", styles['Normal']), bulletColor=CMYKColor(0.81, 0.45, 0.53, 0.23), value='circle')], bulletType='bullet', start='circle')
所以我的问题是:有什么方法可以动态地将 ListItems 附加到 ListFlowable 中?
【问题讨论】: