MCPcopy Create free account
hub / github.com/scanny/python-pptx / add_slide

Method add_slide

src/pptx/slide.py:268–273  ·  view source on GitHub ↗

Return a newly added slide that inherits layout from `slide_layout`.

(self, slide_layout: SlideLayout)

Source from the content-addressed store, hash-verified

266 return len(self._sldIdLst)
267
268 def add_slide(self, slide_layout: SlideLayout) -> Slide:
269 """Return a newly added slide that inherits layout from `slide_layout`."""
270 rId, slide = self.part.add_slide(slide_layout)
271 slide.shapes.clone_layout_placeholders(slide_layout)
272 self._sldIdLst.add_sldId(rId)
273 return slide
274
275 def get(self, slide_id: int, default: Slide | None = None) -> Slide | None:
276 """Return the slide identified by int `slide_id` in this presentation.

Calls 2

add_sldIdMethod · 0.80

Tested by 1