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