Python 3.x odfpy:需要复制现有表
我对odfpy和Python 3有一个问题。我尝试复制Opendocument文本文件中的现有表。我无法从原始表中获取样式信息。这是我的密码:Python 3.x odfpy:需要复制现有表,python-3.x,odfpy,Python 3.x,Odfpy,我对odfpy和Python 3有一个问题。我尝试复制Opendocument文本文件中的现有表。我无法从原始表中获取样式信息。这是我的密码: # templateTable is a table.Table that has to be copied for childNode in templateTable.childNodes: if 'style-name' in str(childNode.attributes): # the next command fai
# templateTable is a table.Table that has to be copied
for childNode in templateTable.childNodes:
if 'style-name' in str(childNode.attributes):
# the next command fails and the python interpreter tells me
# 'style-name' is not in list
style = childNode.getAttribute('style-name')
欢迎帮助 我终于自己找到了解决办法。我想与你分享它,以防其他人不得不处理与我相同的问题。你可以找到代码