1
我想用docx-mailmerge填充Python中的Word文档。一切工作正常,但在国内一些编辑另一台计算机上的Word的另一个版本后,我的脚本在该行给出了一个错误:mailmerge:'ValueError:元素不是这个节点的子元素'是什么意思?
document = MailMerge(template)
错误:
document = MailMerge(template)
File "C:\Python27\lib\site-packages\mailmerge.py", line 79, in __init__
parent.remove(child)
File "src\lxml\lxml.etree.pyx", line 950, in lxml.etree._Element.remove
(src\lxml\lxml.etree.c:50327)
ValueError: Element is not a child of this node.
这是什么意思?
什么是模板? – haifzhan
一个Word文件(* .docx) – Joost
欢迎来到StackOverflow。请阅读并遵守帮助文档中的发布准则。 [最小,完整,可验证的示例](http://stackoverflow.com/help/mcve)适用于此处。在发布您的MCVE代码并准确描述问题之前,我们无法为您提供有效的帮助。 我们应该能够将发布的代码粘贴到文本文件中,并重现您描述的问题。 – Prune