【发布时间】:2013-03-21 18:41:23
【问题描述】:
我正在关注本教程appy.pod,我正在创建一个或多或少类似这样的 dict 列表:
params['reports'] = [{'date': foo.date, 'name': foo.name} for foo in something]
在 libreoffice - 作者我有一个注释
do text for foo in reports
当我执行代码时出现此错误
Syntax error while parsing a note whose content is "[]". In a note, you may specify at most 2 lines: a pod statement and a "from" clause. A Pod statement has the form: do {element} [{command} {expression}]. {element} identifies the part of the document that will be impacted by the command. It must be one of ('text', 'title', 'section', 'table', 'row', 'cell'). Optional {command} can be "if" (conditional inclusion of the element) or "for" (multiple inclusion of the element). For an "if" command, {expression} is any Python expression. For a "for" command, {expression} must be of the form: {name} in {expression}. {name} must be a Python variable name. It is the name of the iteration variable. {expression} is a Python expression that, when evaluated, produces a Python sequence (tuple, string, list, etc). A "from" clause has the form: from {expression}, where {expression} is a Python expression that, when evaluated, produces a valid chunk of odt content that will be inserted instead of the element that is the target of the note.
要记笔记,是否需要激活“跟踪更改”模式?
还有另一个相关的问题,但对我不起作用 Comments are seen as empty, even though they're not
有人可以帮助我,我有什么问题
【问题讨论】:
-
这是一个实际的错误信息?哇。
-
@NPE 是的,可以在 libreoffice Writer 中已经生成的报告中看到
-
那是惊讶而不是怀疑的表达:)
-
对我来说 pod 运行得非常好。制作报告很容易,您可以使用 libreoffice 或 OO 作为所见即所得的报告编辑器。无需激活“跟踪更改”模式即可在评论中编写 pod 代码。让 OO 文档和源代码可供审查。
-
另外,不要从 pip 或 easy_install 安装 pod。下载项目并将其手动包含在您的解决方案中。
标签: python libreoffice