gpt4 book ai didi

python - 使用 Python 打开 Word 文档

转载 作者:太空狗 更新时间:2023-10-29 20:50:51 25 4
gpt4 key购买 nike

<分区>

我正在尝试用 Python 自动打开 Word 文档。我是编程的新手,我听说这个网站帮助了遇到问题的人。

我看了各种问题,发现了这个:

DummyFile = path_to_docx
with open(DummyFile) as f:
source_stream = io(f.read())
document = doc(source_stream)
source_stream.close()

但是当我运行它时,我得到:

 UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 74: character maps to <undefined>

看来这段代码不是我想要的。我相信它正在尝试阅读我的文档并将其放入变量中。不是我想要的。我想要命令,当执行时,将打开 word 文档在 Microsoft Word 中

预期结果:

Word 文档在 Microsoft Word 中打开,如下所示:

here

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com