Recently I'am experimenting with different API's for MS Word file management (writing for now). At this point I need just a simple writing python API. I tried win32com module which prove to be very robust with lack of examples for python online (very little knowledge of VB and C to be able to translate examples from MSDN).
I tried to use python-docx but after install I am getting this traceback for any docx function.
Traceback (most recent call last):
File "C:filepath.py", line 9, in <module>
ispit = newdocument()
NameError: name 'newdocument' is not defined
I had some problems with installation of lxml by source and by easy_install. It was checking for libxlm2 and libxslt binaries. I downloaded them and added environmental paths but the installation trough source or easy_install stopped every time.
Finally I used unofficial python extension package from this site Link.
Installation was fast and there was no errors in the end.
Is there something I can do to make docx work and is there some python win32com related references online? I couldn't find any. (except MSDN(VB not python) and O'Reily's Python programming on win32)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…