0

I am trying to use https://github.com/olebole/python-docx/blob/master/docx.py to do some formatting like italic and underline from what I understand it is a extension of the https://github.com/mikemaccana/python-docx project. I have python-docx project installed using pip but I am not sure how to install the https://github.com/olebole/python-docx/blob/master/docx.py project so I just overwrote the docx.py file in my python site-packages folder. But that seems to give me a lot of issues when I write a simple code like this: d = docx.open('example.docx',mode = 'create') d += docx.Text('This is just some test that needs to be italic.',italic = True) docx.writeto('Dokument.docx') docx.close()

I could find just one example on here https://github.com/olebole/python-docx/issues/1 that I am trying to follow.

If someone can point me in the correct direction on this it would really help me out.

4

1 回答 1

1

对我来说,这个项目的代码看起来没有维护。我强烈建议您寻找其他可以让您完成任务的项目。

例如https://github.com/mikemaccana/python-docx让你这样

body.append(paragraph([('This is italic text', 'i')]))
于 2013-08-06T17:15:51.973 回答