Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to edit doc files with Python?

Tags:

python

ms-word

I have a set of .doc files which I want to perform some simple changes to (e.g. set the font of all the text in each file to be arial).

I don't want to do all the operations manually. I thought I'll try to automate it with a Python script. Is it a complicated task? How is it done?

I use Python 3.

like image 983
snakile Avatar asked Nov 19 '10 16:11

snakile


People also ask

Can python read Word documents?

You can use python-docx2txt library to read text from Microsoft Word documents. It is an improvement over python-docx library as it can, in addition, extract text from links, headers and footers. It can even extract images.

Can DOC file be edited?

You can upload and download files with the Google Docs app for Android. Import: You can open and edit DOC, DOCX, ODT, TXT, RTF, and HTML files.


1 Answers

The Python docx module should be helpful.

(2nd time this question was asked today!)

like image 66
user225312 Avatar answered Sep 19 '22 23:09

user225312