from reportlab.platypus import ListFlowable, ListItem not working

牧云@^-^@ 提交于 2019-12-10 12:18:26

问题


I am a newbie to python. I have to create an ordered list in my pdf document using Reportlab. I found these two classes ListFlowable(), ListItem() in the user-guide of Reportlab to do the same. But the very first import statement for these classes is not working.

from reportlab.platypus import ListFlowable, ListItem

This statement gives me the following error:

ImportError: cannot import name ListFlowable

How can I use these classes? I am using python 2.6, reportlab 2.5.


回答1:


In my install of ReportLab 2.5 this isn't available. I see it's there in the documentation, but searching through the code there is no such thing as a ListFlowable or ListItem. This might be something that's only available in the closed-source portion of ReportLab and not the open source.

If you need to make lists, though, you can fairly easily get similar results using iterator variables and paragraph styles. That's the way I've always done it.



来源:https://stackoverflow.com/questions/6715530/from-reportlab-platypus-import-listflowable-listitem-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!