是否有用于将 RTF 转换为纯文本的 Python 模块? [英] Is there a Python module for converting RTF to plain text?

查看:101
本文介绍了是否有用于将 RTF 转换为纯文本的 Python 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

理想情况下,我想要一个不需要超级用户访问权限的模块或库;我在工作环境中的权限有限.

Ideally, I'd like a module or library that doesn't require superuser access to install; I have limited privileges in my working environment.

推荐答案

OpenOffice 有一个 RTF 阅读器.您可以使用 python 编写 OpenOffice 脚本,查看此处了解更多信息.

OpenOffice has a RTF reader. You can use python to script OpenOffice, see here for more info.

您可能可以尝试在 Windows 上使用魔法 com-object 来读取任何带有 ms-binary 气味的东西.不过我不建议这样做.

You could probably try using the magic com-object on Windows to read anything that smells ms-binary. I wouldn't recommend that though.

其实解析原始数据可能不会很难,看这个例子 用 .bat/QBasic 编写.

Actually parsing the raw data probably won't be very hard, see this example written in .bat/QBasic.

DocFrac 是 RTF、HTML 和文本之间的免费开源转换器.可以使用 Windows、Linux、ActiveX 和 DLL 平台.用 python 包装它可能很容易.

DocFrac is a free open source converter betweeen RTF, HTML and text. Windows, Linux, ActiveX and DLL platforms available. It will probably be pretty easy to wrap it up in python.

RTF::TEXT::Converter - 用于将 RTF 转换为文本的 Perl 扩展.(以防您在使用 DocFrac 时遇到问题).

RTF::TEXT::Converter - Perl extension for converting RTF into text. (in case You have problems withg DocFrac).

官方富文本格式 (RTF) 规范,版本 1.7,由 Microsoft 提供.

Official Rich Text Format (RTF) Specifications, version 1.7, by Microsoft.

祝你好运(在你的工作环境中拥有有限的特权).

Good luck (with the limited privileges in Your working environment).

这篇关于是否有用于将 RTF 转换为纯文本的 Python 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆