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

Method index

src/pptx/slide.py:380–388  ·  view source on GitHub ↗

Return zero-based index of `slide_layout` in this collection. Raises `ValueError` if `slide_layout` is not present in this collection.

(self, slide_layout: SlideLayout)

Source from the content-addressed store, hash-verified

378 return default
379
380 def index(self, slide_layout: SlideLayout) -> int:
381 """Return zero-based index of `slide_layout` in this collection.
382
383 Raises `ValueError` if `slide_layout` is not present in this collection.
384 """
385 for idx, this_layout in enumerate(self):
386 if slide_layout == this_layout:
387 return idx
388 raise ValueError("layout not in this SlideLayouts collection")
389
390 def remove(self, slide_layout: SlideLayout) -> None:
391 """Remove `slide_layout` from the collection.

Calls

no outgoing calls