Word documents are capable of adding images to show graphs or any other kind of extra information. Being able to add an image is a great way of creating rich reports.
We'll see in this recipe how to include an existing file in a Word document.
Word documents are capable of adding images to show graphs or any other kind of extra information. Being able to add an image is a great way of creating rich reports.
We'll see in this recipe how to include an existing file in a Word document.
We'll use the python-docx module to process Word documents:
$ echo "python-docx==0.8.6" >> requirements.txt
$ pip install -r requirements.txt
We need to prepare an image to include in the document. We'll use the file in GitHub at https://github.com/PacktPublishing/Python-Automation-Cookbook/blob/master/Chapter04/images/photo-dublin-a1.jpg, which shows a view of Dublin. You can download it on the command line...