Created
April 21, 2024 18:10
-
-
Save documentprocessing/d103ec68dc7c3ca93a65de438d3562e1 to your computer and use it in GitHub Desktop.
Add Bullets to PowerPoint PPTX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pptx import Presentation | |
prs = Presentation() | |
slide_with_bullet_layout = prs.slide_layouts[1] | |
slide = prs.slides.add_slide(slide_with_bullet_layout) | |
shapes = slide.shapes | |
title_shape = shapes.title | |
body_shape = shapes.placeholders[1] | |
title_shape.text = 'Adding a Bullet Slide' | |
text_frame = body_shape.text_frame | |
text_frame.text = 'Find the bullet slide layout' | |
paragraph = text_frame.add_paragraph() | |
paragraph.text = 'Use _TextFrame.text for first bullet' | |
paragraph.level = 1 | |
paragraph = text_frame.add_paragraph() | |
paragraph.text = 'Use _TextFrame.add_paragraph() for subsequent bullets' | |
paragraph.level = 2 | |
prs.save('BulletSlideExample.pptx') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment