FAQ Database Discussion Community

How to find a list in docx using python?

I'm trying to pull apart a word document that looks like this: 1.0 List item 1.1 List item 1.2 List item 2.0 List item It is stored in docx, and I'm using python-docx to try to parse it. Unfortunately, it loses all the numbering at the start. I'm trying to...

Cx_freeze exe failing to completely import docx

I have a pretty hefty python script that I'm trying to cx_freeze, however when I run the executable file I keep getting the same error and it appears to be related to the docx module. I'm using Python 3.3.5 with docx 0.7.6-py33 on a Windows 8.1 machine. This is my...

How to properly indent with python-docx?

Indentation seems pretty straightforward, and terminal prints back the proper indentation, but the same indentation is not reflected in my saved Word docx. Am I doing something wrong here? from docx import Document from docx.shared import Inches worddoc = Document() paragraph = worddoc.add_paragraph('Left Indent Test') paragraph.left_indent = Inches(.25) print(paragraph.left_indent.inches) worddoc.save('left_indent.docx')...