# 使用 Python 删除 PPTX 注释

> 去除PPTX演示文稿注释的Python源码

Source: https://products.aspose.com/slides/zh/python-net/annotation/pptx/
Updated: 2023-04-18



## 通过 Python 从 PPTX 中删除评论

为了从 PPTX 文件中删除注释，我们将使用 [Aspose.Slides for Python via .NET](https://products.aspose.com/slides/zh/python-net/) API，这是一个功能丰富的 API，强大且易于使用的 Python 平台文档操作 API。

### 从 PPTX 中删除注释 - Python

```python

import aspose.slides as slides

with slides.Presentation("example.pptx") as presentation:
    # Deletes all comments from the presentation
    for author in presentation.comment_authors:
        author.comments.clear()

    # Deletes all authors
    presentation.comment_authors.clear()

    presentation.save("example_out.pptx", slides.export.SaveFormat.PPTX)
```

## 如何通过 Python 从 PPTX 中删除评论

通过 .NET 安装 **Aspose.Slides for Python**。请参阅 [**安装**](https://docs.aspose.com/slides/python-net/installation/)。

使用 Presentation 类的实例加载 PPTX

遍历加载的 PPTX 的所有作者

删除作者的所有评论

最后删除所有作者

## 其他支持的注释格式
