Lecture

Loading a PPT Template

Now, using the Excel data, we need to load the certificate template to create a slide for each recipient.

We'll learn how to use the python-pptx library to load a pre-prepared certificate template.

Loading the PPT Template
import openpyxl from pptx import Presentation from io import BytesIO from pptx.enum.shapes import MSO_SHAPE_TYPE # Load the PowerPoint file presentation = Presentation("input_file.pptx") # Print information of the first slide first_slide = presentation.slides[0] # Output placeholder information on the slide for shape in first_slide.placeholders: # Print placeholder text if shape.has_text_frame: print(f"placeholder: {shape.text}")

The code above loads information from the first slide and prints the placeholder information on the slide.

Output placeholder information on the slide
placeholder: <AWARD_NAME> placeholder: <CONTENT> placeholder: <NAME> placeholder: <ORGANIZATION>

This way, we can load the information from the first slide of the PPT template and verify its contents.

We will use this template to add slides that reflect the recipient's information.

In the next lesson, we will cover the process of creating slides and filling in text based on the data loaded from the Excel file.

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help

Code Editor

Run
Generate

Execution Result

Input/Result