Python – Reading/Writing MS Word files in Python


Is it possible to read and write Word (2003 and 2007) files in Python without using a COM object?
I know that I can:

f = open('c:\file.doc', "w")

but Word will read it as an HTML file not a native .doc file.

Best Solution

See python-docx, its official documentation is available here.

This has worked very well for me.