Код: Выделить всё
import docx2txt
text = docx2txt.process("test1.docx")
print(text)
Код: Выделить всё
import pypandoc
text = pypandoc.convert_file('your_file.docx', 'plain')
print(text)
не удалось распаковать контейнер docx: не найден конец центрального каталога
подпись
Код: Выделить всё
import docx
def read_cyrillic_docx(file_path):
doc = docx.Document(file_path)
full_text = [para.text for para in doc.paragraphs]
return '\n'.join(full_text)
text = read_cyrillic_docx('test1.docx')
print(text)
'test1.docx'
Как открыть эти файлы с помощью Python? Заранее спасибо!
Подробнее здесь: https://stackoverflow.com/questions/798 ... pypandoc-c
Мобильная версия