We continue using the
python-pptx module for the recipes in this section. So, we don't have to install any new modules. We will learn how to create a blank presentation and add slides to it and, of course, some content on it.
from pptx import Presentation prs = Presentation() slide = prs.slides.add_slide(prs.slide_layouts) slide.shapes.title.text = "Yo, Python!" slide.placeholders.text = "Yes it is really awesome" prs.save('yoPython.pptx')
If we run the preceding piece of code, it will create a PPTX file with the title as Yo, Python! ...