30 lines
684 B
Python
30 lines
684 B
Python
from __future__ import annotations
|
|
|
|
from itertools import islice
|
|
from pathlib import Path
|
|
|
|
from pptx import Presentation
|
|
from pptx.enum.shapes import MSO_SHAPE_TYPE
|
|
|
|
|
|
def main() -> None:
|
|
base_dir = Path(__file__).resolve().parent
|
|
path = base_dir / "outputs" / "ai_work.pptx"
|
|
prs = Presentation(str(path))
|
|
|
|
pics = sum(
|
|
1
|
|
for slide in prs.slides
|
|
for sh in slide.shapes
|
|
if sh.shape_type == MSO_SHAPE_TYPE.PICTURE
|
|
)
|
|
first5_shapes = [len(s.shapes) for s in islice(prs.slides, 5)]
|
|
|
|
print(f"file={path}")
|
|
print(f"slides={len(prs.slides)} pictures={pics} first5_shapes={first5_shapes}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|