0

I know this module is not very popular but if you know the answer then please help me out with it.

My code is:

from pptx import Presentation

prs = Presentation('do.pptx')
title_slide_layout = prs.slides_layouts[0]
# print(len(prs.slide.slide_layout.shapes))
slide = prs.slides.add_slide(title_slide_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]

title.text = "Python 3.6 - Turtle Race"
subtitle.text = "Data Analytics&Visualization with random generated data"

prs.save("out.pptx")

My Error is:

Traceback (most recent call last):
  File "D:/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!_!Piton/turtleRace/presentationMaker.py", line 8, in <module>
    title_slide_layout = prs.slides_layouts[0]
AttributeError: 'Presentation' object has no attribute 'slides_layouts'

A picture of my project interpreter

So Why I have this error?

Marci
  • 129
  • 1
  • 13

0 Answers0