Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create word file (.doc) with python

Tags:

python

ms-word

I have have to generate a 2003 compatible doc file from python without using external program like OpenOffice or embedded language like java using Jasper, but I have not found a way to do it. Creating a docx is quite simple and not suppose a problem, but the doc file is another history. As an alternative solution I tried to generate a rtf file, but the unicode incompatibility (there is a library out there solving this) and the lack of features don't allow me to go further and meet my needs. Any advice or solution? Thanks in advance!

like image 479
castledom04 Avatar asked Aug 26 '26 00:08

castledom04


1 Answers

A google for python generate word document lead to a lot of good results. It seems that either py docx or win32com.client are useful libraries.

To read docx files with Word 2003 you have to install a plugin.

like image 113
Paul Hiemstra Avatar answered Aug 27 '26 14:08

Paul Hiemstra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!