Skip to content
Back to skills

Pptx

ASecurity

读取、创建或修改 PowerPoint 演示文稿(.pptx)——提取文字、批量生成幻灯片、套用版式。当用户涉及 PPT/pptx 文件处理时使用。需要本机 Python + python-pptx。

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 6, 2026
ai-agentspythonshellbash

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 6, 2026

npx -y skills add Ducktang123/claude-code-deepseek --skill pptx --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pptx?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pptx
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ducktang123-pptx/badge)](https://www.skillsdirectory.com/skills/ducktang123-pptx)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pptx
description: 读取、创建或修改 PowerPoint 演示文稿(.pptx)——提取文字、批量生成幻灯片、套用版式。当用户涉及 PPT/pptx 文件处理时使用。需要本机 Python + python-pptx。
---

# PPT 演示文稿处理 (.pptx)

用 Python 的 `python-pptx` 库读写 PPT。通过 Bash/PowerShell 运行 Python 脚本完成。

## 前置
依赖库:`python-pptx`(安装包已自动装好;缺失则 `pip install python-pptx -i https://pypi.tuna.tsinghua.edu.cn/simple`)。

## 常见任务

### 读取文字
```python
from pptx import Presentation
prs = Presentation("输入.pptx")
for i, slide in enumerate(prs.slides, 1):
    print(f"--- 第 {i} 页 ---")
    for shape in slide.shapes:
        if shape.has_text_frame:
            print(shape.text_frame.text)
```

### 新建幻灯片
```python
from pptx import Presentation
from pptx.util import Inches, Pt
prs = Presentation()
# 标题页
slide = prs.slides.add_slide(prs.slide_layouts[0])
slide.shapes.title.text = "汇报标题"
slide.placeholders[1].text = "副标题 / 作者"
# 标题+内容页
slide = prs.slides.add_slide(prs.slide_layouts[1])
slide.shapes.title.text = "要点"
tf = slide.placeholders[1].text_frame
tf.text = "第一点"
tf.add_paragraph().text = "第二点"
prs.save("输出.pptx")
```

## 原则
- 用版式(slide_layouts)生成更整齐,少手动摆位置。
- 中文注意字号和字体,避免溢出。
- 处理完告诉用户输出文件路径。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.