用于“python打开文档”的循环错误

时间:2013-03-21 18:41:24

标签: python libreoffice pod

我正在按照本教程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

有人可以帮助我,我有什么不对

1 个答案:

答案 0 :(得分:2)

解决方案在appy forum

  

你使用什么pod版本?   请注意,在Pypi上,不推荐使用包appy.pod和appy.shared。使用新的包appy。   加埃唐

我所做的是使用pip install安装pod并且不推荐使用offcourse,所以你必须从这里下载appy Download并将appy.xxx.zip中的“appy”文件夹复制到“site-packages” “Python解释器的文件夹。