跳到正文
Skillpedia
通用编程48k · #5551

python-pptx-generator

它能做什么

可以生成一份完整的 Python 脚本,用来自动创建 PowerPoint 演示文稿(.pptx)。你给出一个主题,它就会输出一份包含真实内容和合理结构的幻灯片脚本。

适用场景

  • ✓你想要一个能生成 .pptx 文件的 Python 脚本时。
  • ✓你需要起草幻灯片内容,并直接写进脚本里时。
  • ✓你想快速做一个用于演示或课堂的演示文稿生成器时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/python-pptx-generator/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/python-pptx-generator/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我写一个 Python 脚本,生成一份 5 页的演示文稿,介绍太阳能对房主的好处。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会先理解主题和你想要的演示文稿结构。然后,它会使用 `python-pptx` 库编写 Python 代码,为每一页创建标题和文字,并保存最终文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Python PPTX Generator

Overview

Use this skill when the user wants a ready-to-run Python script that creates a PowerPoint presentation with python-pptx. It focuses on turning a topic brief into a complete slide deck script with real slide content, sensible structure, and a working save step.

When to Use This Skill

  • Use when the user wants a Python script that generates a .pptx file automatically
  • Use when the user needs slide content drafted and encoded directly into python-pptx
  • Use when the user wants a quick presentation generator for demos, classes, or internal briefings

How It Works

Step 1: Collect the Deck Brief

Ask for the topic, audience, tone, and target number of slides if the request does not already include them. If constraints are missing, pick conservative defaults and state them in the generated script comments.

Step 2: Plan the Narrative Arc

Outline the deck before writing code:

  1. Title slide
  2. Agenda or context
  3. Core teaching or business points
  4. Summary or next steps

Keep the slide count realistic for the requested audience and avoid filler slides.

Step 3: Generate the Python Script

Write a complete script that:

  • imports Presentation from python-pptx
  • creates the deck
  • selects appropriate built-in layouts
  • writes real titles and bullet points
  • saves the file with a clear filename
  • prints a success message after saving

Step 4: Keep the Output Runnable

The final answer should be a Python code block that can run after installing python-pptx. Avoid pseudocode, placeholders, or missing imports.

Examples

Example 1: Educational Deck

User: Create a 5-slide presentation on the basics of machine learning for a high school class.
Output: A complete Python script that creates a title slide, overview, core concepts, examples, and recap.

Example 2: Business Briefing

User: Generate a 7-slide deck for sales leadership on Q2 pipeline risks and mitigation options.
Output: A python-pptx script with executive-friendly slide titles, concise bullets, and a final recommendations slide.

Best Practices

  • ✅ Use standard python-pptx layouts unless the user asks for custom positioning
  • ✅ Write audience-appropriate bullet points instead of placeholders
  • ✅ Save the output file explicitly in the script, for example output.pptx
  • ✅ Keep slide titles short and the bullet hierarchy readable
  • ❌ Do not return partial snippets that require the user to assemble the rest
  • ❌ Do not invent unsupported styling APIs without checking python-pptx capabilities

Security & Safety Notes

  • Install python-pptx only in an environment you control, for example a local virtual environment
  • If the user will run the script on a shared machine, choose a safe output path and avoid overwriting existing presentations without confirmation
  • If the request includes proprietary or sensitive presentation content, keep it out of public examples and sample filenames

Common Pitfalls

  • Problem: The generated script uses placeholder text instead of real content
    Solution: Draft the narrative first, then turn each slide into specific titles and bullets

  • Problem: The deck uses too many slides for the requested audience
    Solution: Compress the outline to the most important 4 to 8 slides unless the user explicitly wants a longer deck

  • Problem: The script forgets to save or print a completion message
    Solution: Always end with prs.save(...) and a short success print

Related Skills

  • @pptx-official - Use when the task is about inspecting or editing existing PowerPoint files
  • @docx-official - Use when the requested output should be a document instead of a slide deck

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题

生成的脚本开箱即用吗?

可以。脚本是完整的,安装 `python-pptx` 库之后就可以直接运行。

如果我没有指定页数会怎样?

AI 会使用一个合理的默认页数,通常在 4 到 8 页之间,并会在生成的脚本注释里说明。

我能让 AI 做一种特定的视觉风格吗?

AI 使用的是 `python-pptx` 库中的标准版式。它不会制作复杂的自定义视觉风格,但会确保内容组织得井井有条。

详情

作者的原始描述

Generate complete Python scripts that build polished PowerPoint decks with python-pptx and real slide content.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5551
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能