Opening a Word document with a password using the docx library

I am trying to open a document with a password.

I am using docx package - a bit old

from docx import opendocx, getdocumenttext

and further

 document = opendocx(filename)

I was wondering if there are options on opendocx so that it can open password-protected text documents - I know the password. I checked the github repo here: https://github.com/mikemaccana/python-docx , but didn't see an option. I am trying to avoid rewriting code to use a newer package, but this may be inevitable.

+4
source share
2 answers

python-docx . , , , python-docx :

, . , . , Word, .

Zip-, .docx( Zip ), -, . . , , zip StringIO .

, , :)

Docx , . , . docx :

, , , - docx docx. , .

+4

.docx , , docx , , , , XML. MS-OFFCRYPTO - Microsoft https://msdn.microsoft.com/en-us/library/office/cc313071%28v=office.12%29.aspx?f=255&MSPPError=-2147217396. . # https://www.lyquidity.com/devblog/?p=35. python, , , XML .

, MS Word LibreOffice, , , python.

0

All Articles