与"python打开文档"循环错误 [英] error in loop with for "python open document"

查看:113
本文介绍了与"python打开文档"循环错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照本教程 appy.pod 的操作,并且正在创建更多或更多的字典列表.少这样的东西:

I'm follow this tutorial appy.pod and I'm creating a list of dict more or less something like this:

params['reports'] = [{'date': foo.date, 'name': foo.name} for foo in something]

在libreoffice中-作家,我有一个注释

and in the libreoffice - writer i have a note with this

do text for foo in reports

当我执行代码时,出现此错误

and when I excecute the code I get this error

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.

要进行记录,是否需要激活曲目更改"模式?

to make a note, is necessary active the 'track changes' mode?

还有另一个相关问题,但对我不起作用 评论被视为空的,即使它们不是空的

there is another question related but that do not work for me Comments are seen as empty, even though they're not

有人可以帮助我,我有什么错

somebody can help me, what I have wrong

推荐答案

解决方案在此处 appy论坛

您使用的是哪个Pod版本? 请注意,在Pypi上,不赞成使用appy.pod和appy.shared软件包.使用新的包appy. 加丹

What pod version do you use? Note that, on Pypi, packages appy.pod and appy.shared are deprecated. Use new package appy. Gaetan

我所做的是安装带有pip安装的pod,并且不建议使用offcourse,因此您必须从此处下载appy 下载,然后将appy.xxx.zip中的"appy"文件夹复制到您的Python解释器的"site-packages"文件夹中.

That I did was install pod with pip install and offcourse is deprecated, so you have to download the appy from here Download and copy the "appy" folder from appy.xxx.zip to the "site-packages" folder of your Python interpreter.

这篇关于与"python打开文档"循环错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆