Here's what my example document, TestDocument.docx
, looks like.

Note: The word "Italic" is in Italics, but "Emphasis" uses the style, Emphasis.
If you install the python-docx
module. This is a fairly simple exercise.
>>> from docx import Document
>>> document = Document('TestDocument.docx')
>>> for p in document.paragraphs:
... for run in p.runs:
... print run.text, run.italic, run.bold
...
Test Document None None
Italics True None
Emp None None
hasis None None
>>> [[run.text for run in p.runs if run.italic] for p in document.paragraphs]
[[], ['Italics'], []]
The Run.italic
attribute captures whether the text is formatted as Italic, but it doesn't know if a text block has a Style that is rendered in Italic, but it can be detected by checking Run.style.name (if you know what styles in your document are rendered in Italics.
>>> [[run.text for run in p.runs if run.style.name=='Emphasis'] for p in document.paragraphs]
[[], [], ['Emp', 'hasis']]