Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to edit MS word doc files with Python?

Tags:

python

I need to create a lot of old .doc files (MS word 97) and I'm wondering if there is any way to do in Python 3. I've been researching around but all I can find are libraries for the newer .docx files or playing with the OpenOffice API.

The output files would be just a .doc file with specific formatting and some tables with text inside the cells. No images or fancy stuff needed, but I hesitate on installing external programs like OpenOffice because this script will need to run on a few different computers. So I'm wondering if there is just a library that I can import.

I accept suggestions for other programming languages as well, but Python would be perfect.

like image 226
Saelyth Avatar asked Feb 20 '18 11:02

Saelyth


1 Answers

yes, try http://python-docx.readthedocs.io/en/latest/

to install:

pip install python-docx

like image 128
Arkadiusz Tymieniecki Avatar answered Oct 18 '22 07:10

Arkadiusz Tymieniecki