python-docx style_id error while creating a word document

前端 未结 1 1231
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 03:24

I\'m following the tutorial available on python-docx site to create a MS-Word document but I\'m getting an error:

M:\\Sites>python word.py
C:\\Program Fil         


        
相关标签:
1条回答
  • 2021-01-18 03:45

    Simple but hard to debug. Just add space between words in style.

    document.add_paragraph('Intense quote', style='IntenseQuote')

    Changes to:

    document.add_paragraph('Intense quote', style='Intense Quote')

    0 讨论(0)
提交回复
热议问题