Проблема:
Я пытаюсь скопировать слайд из презентации в другую презентацию, но она возвращает ошибку:
Traceback (последний последний вызов):
File "C:\Users\vuse1\documents\visual studio 2015\Projects\PythonApplication\PythonApplication\PythonApplication.py", line 8, in
prs2.slides.add_slide(copySlide)
File "C:\Python27\lib\site-packages\pptx\slide.py", line 287, in add_slide
slide.shapes.clone_layout_placeholders(slide_layout)
File "C:\Python27\lib\site-packages\pptx\shapes\shapetree.py", line 515, in
clone_layout_placeholders for placeholder in slide_layout.iter_cloneable_placeholders():
AttributeError: 'Slide' object has no attribute 'iter_cloneable_placeholders'
Код:
from pptx import Presentation
prs1 = Presentation("C:\\Users\\vuse1\Desktop\\first.pptx")
prs2 = Presentation("C:\\Users\\vuse1\Desktop\\second.pptx")
copySlide=prs1.slides[0]
prs2.slides.add_slide(copySlide)
prs2.save("C:\\Users\\vuse1\Desktop\\second.pptx")