Python 中的 OLE 复合文档

发布于 2024-07-24 00:07:15 字数 236 浏览 7 评论 0原文

如何使用 Python 解析 Microsoft OLE 复合文档

编辑:抱歉,我忘了说我也需要写支持。简而言之,我有一个 OLE 复合文件,我必须读取它,修改一下并写回磁盘(它是一个文件)使用 CAD 应用程序制作)

how would you parse a Microsoft OLE compound document using Python?

Edit: Sorry, I forgot to say that I need write support too.. In short, I have an OLE compound file that I have to read, modify a bit and write back to disk (it's a file made with a CAD application)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沫雨熙 2024-07-31 00:07:16

为了完整起见:在 Linux 上还有 GNOME 结构化文件库(但 Debian/Ubuntu 的默认包有Python 支持已禁用,因为 Python 绑定自 2006 年以来不再受支持)和 POIFS Java 库。

For completeness: on Linux there's also the GNOME Structured File Library (but the default package for Debian/Ubuntu has Python support disabled, since the Python bindings are unsupported since 2006) and the POIFS Java library.

念三年u 2024-07-31 00:07:15

刚刚找到OleFileIO_PL但它没有写支持..:/< /s> 从版本 0.40 (2014) 开始,它具有写入支持。

编辑: 看起来有一种方法(尽管仅限 Windows)也支持写入.. pywin32 扩展(StgOpenStorage 函数和有关的)

Just found OleFileIO_PL, but it doesn't have write support.. :/ and as of version 0.40 (2014) it has write support.

Edit: Looks like there's a way (though Windows-only) that supports writing too.. The pywin32 extensions (StgOpenStorage function and related)

浅浅 2024-07-31 00:07:15

另一种选择:xlrd 包有一个阅读器。 xlwt 包(pyExcelerator 的一个分支)有一个编写器。 他们可以轻松地处理数百 MB 的文件大小; 这些软件包已经广泛使用了大约 4 年。 复合文档模块的目标是尽可能高效地将“工作簿”流传入和传出 Excel .xls 文件,但具有相当的通用性。 与 OleFileIO_PL 不同,它们不提供对属性流内部的访问。

http://pypi.python.org/pypi/xlrd
http://pypi.python.org/pypi/xlwt 

如果您决定使用它们并需要帮助,请在此论坛中提问:

http://groups.google.com/group/python-excel

An alternative: The xlrd package has a reader. The xlwt package (a fork of pyExcelerator) has a writer. They handle filesizes of 100s of MB cheerfully; the packages have been widely used for about 4 years. The compound document modules are targetted at getting "Workbook" streams into and out of Excel .xls files as efficiently as possible, but are reasonably general-purpose. Unlike OleFileIO_PL, they don't provide access to the internals of Property streams.

http://pypi.python.org/pypi/xlrd
http://pypi.python.org/pypi/xlwt 

If you decide to use them and need help, ask in this forum:

http://groups.google.com/group/python-excel

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文