title: How to apply a style to a paragraph with python-docx?
body: <p>I am trying to apply a style to a paragraph in a document using the python-docx module.  I can write new text, but I cannot apply a different style to a previously-written paragraph.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>x = docx.Document('Sample.docx')
  
  x
  Out[81]: &lt;docx.api.Document at 0x121cebed0&gt;
  
  x.paragraphs[2].style
  Out[82]: 'Normal'
  
  x.paragraphs[2].style = 'Title'
  
  x.paragraphs[2].style
  Out[84]: 'Normal'
  </code></pre>
  
  <p>I cannot tell from the documentation whether this should work or not.  It seems to indicate that paragraph style is writable, but there is no example of this use case in the documentation.</p>
  
  <p>Please let me know whether this is my problem, or if the functionality is not implemented yet.</p>