小编Bha*_*ane的帖子

如何使用任何库将RTF字符串转换为python中的纯文本

我想在不使用正则表达式的情况下将rtf字符串转换为纯文本

rtfstring = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0 Arial;}}{\colortbl;\red255\green0\blue0;\red1\green1\blue1;}\viewkind4\uc1\pard\f0\fs18 {\b Amount/complexity of data to be reviewed:\b0}\par{- Review and summarization of old records}\par}'
Run Code Online (Sandbox Code Playgroud)

纯文本将是

Plaintext = "Amount/complexity of data to be reviewed:- Review and summarization of old records"
Run Code Online (Sandbox Code Playgroud)

python

1
推荐指数
1
解决办法
4751
查看次数

标签 统计

python ×1