Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Friday, March 30, 2018
Python docx Tutorial
$ pip install python-docx
>>> from docx import Document
Then, a basic one is :
doc = Document.('docName.docx')
for para in doc.paragraphs :
print para.text
How should you know that you have paragraphs and text for each para? You can use the TAB key when you've typed "doc." (without the quotes, of course).
Labels:
docx,
microsoft word,
python
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment