【问题标题】:How can we save a file with different save as type version using python?我们如何使用 python 保存具有不同保存类型版本的文件?
【发布时间】:2022-07-06 04:05:52
【问题描述】:

Word XML 文档 (.xml) 到 Word 2003 XML 文档(.xml),使用 python 代码。 在这里,更改扩展名不起作用,因为 .xml 对两者都是一样的。

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: python python-3.x python-2.7 scripting build-automation


【解决方案1】:

有点不清楚你在问什么,但这将是 pandas 方法:

import pandas as pd

df.to_xml('new.xml')

尝试不同的编码类型

df.to_xml('new.xml', encoding='type')

其中“type”是您需要的编码类型,例如 utf-8 或其他。希望这会有所帮助

【讨论】:

    猜你喜欢
    • 2017-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多