更新时间:2023-01-18 18:43:19
这是函数的作用,用于将一些重复的任务抽象为(函数)调用:
This is what functions are for, to abstract some repetative task down to a (function) call:
def add_slide(prs, layout, title):
"""Return slide newly added to `prs` using `layout` and having `title`."""
slide = prs.slides.add_slide(layout)
slide.shapes.title.text = title
return slide
title_slide_layout = prs.slide_layouts[1]
slide = add_slide(prs, title_slide_layout, "Summary Table")
slide2 = add_slide(prs, title_slide_layout, "New Table")
slide3 = add_slide(prs, title_slide_layout, "Old Table")
您的第二个问题是一个完全不同的问题,我建议您分别提出. ***是围绕一次一个问题的格式设计的.
Your second question is an entirely different question and I recommend you ask it separately. *** is designed around a one-question-at-a-time format.