title: How to add hyperlink to an image in python-docx
body: <p>I added an image using python docx. Now, I want to add a hyper-link. How to do that?</p>
  
  <pre><code>import io
  import urllib
  from docx import Document
  from docx.shared import Inches
  
  document = Document()
  p = document.add_paragraph()
  r = p.add_run()
  url = r'http://www.example.com/a.jpg'
  io_url = io.BytesIO(urllib.request.urlopen(url).read())
  r.add_picture(io_url)
  #TODO: add a hyperlink 'http://mywebsite.com' to r
  document.save('example.docx')
  </code></pre>
  
  <p>Thank you very much.</p>