使用Python将.doc转换为纯文本 [英] Converting .doc to pure text using Python

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

问题描述

我正在尝试使用textract将我的.doc文件转换为纯文本.

I am trying to use textract to convert my .doc files to pure text.

import textract
text = textract.process('path/to/file.extension')

但是我收到此错误

AttributeError: 'module' object has no attribute 'process'

推荐答案

请确保您尝试运行的Python文件未命名为textract.py.

Make sure that the Python file you are trying to run is not named textract.py.

如果是名称,则会出现错误:

If that's the name, you will get the error:

AttributeError: 'module' object has no attribute 'process'

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

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