Run python-pptx online — see the slide in a second
python-pptx writes XML; it can't show you the slide. The usual loop is run the script, open PowerPoint, look, close, repeat. Paste your code below instead — it runs in a sandbox and the rendered slide comes straight back, with lint findings: overlapping boxes, shapes off the canvas, unreadable font sizes — the bugs python-pptx lets you write blind. Free, no account.
How it works
- Your code runs in a single-use sandbox process with an import allowlist and a 10-second cap. It's the same sandbox behind SlideForge's code-mode API.
- Paste your script as it is. The presentation it saves is the one you see;
save()never writes to your path, andPresentation("template.pptx")uses the python-pptx default template, with a note. Or writedef build(prs):to get a 16:9 slide with SlideForge helpers (add_text_box,add_box, widgets) preloaded. - The preview renders slide 1 at 768px. Full renders — the editable
.pptx, vector PDF export, and full-resolution images of every slide, none of which python-pptx can produce locally — live in the playground at $0.05 per render, first 60 slides free.
Use it from the command line
curl -X POST https://api.slideforge.dev/v1/tools/preview-code \
-H "Content-Type: application/json" \
-d '{"code": "def build(prs):\n slide = prs.slides.add_slide(prs.slide_layouts[6])\n add_text_box(slide, 1, 1, 8, 1, \"Hello\", font_size=30)"}'Returns the preview as an inline base64 PNG plus any diagnostics. Rate-limited per IP; the authenticated /v1/render/code endpoint has no per-minute cap and returns signed .pptx / preview URLs.
FAQ
How do I preview a python-pptx slide without opening PowerPoint?
Paste your code into the editor at slideforge.dev/tools/python-pptx-preview and hit Run. The code executes in a sandbox and the rendered slide comes back as an image in about a second. python-pptx itself cannot render slides — it writes XML — so normally you'd run your script, open the file in PowerPoint, look, and repeat. This tool replaces that loop.
Is it free? Do I need an account?
The preview is free with no account: one slide per run, 768px, rate-limited per IP. A free account unlocks the playground with full renders — the .pptx file, PDF export, full-resolution images, themes — at $0.05 per render, with a 60-slide free trial.
What code does it accept?
Paste your python-pptx script as it is — prs = Presentation(), your slides, prs.save(...). The sandbox has no files, so save() does not write to your path (we show the presentation you saved), and Presentation("your_template.pptx") falls back to the python-pptx default template, with a note. You can also write def build(prs): and we pass in a 16:9 Presentation with SlideForge helpers like add_text_box and add_box and themes preloaded. Your code runs in a single-use sandbox process with an import allowlist.
Does it check my slide for layout bugs?
Yes — every preview runs a static lint over the produced slide: overlapping shapes, boxes hanging off the canvas edge, zero-size shapes, fonts too small to read, and chart-semantic checks (waterfalls that don't reconcile, funnels that aren't monotonic, leftover placeholder text). python-pptx itself validates nothing — it will happily write a slide with two boxes on the same coordinates. The findings appear under the preview; in the playground, a free Validate button runs the same lint without rendering, and paid renders can add an AI visual review on top.
Can I get a PDF or images out of my python-pptx code?
Yes — that's the part python-pptx can't do at all (it has no rendering). Run your code in the playground and download the .pptx, a vector PDF, or full-resolution PNG renders of every slide. Same $0.05-per-render price for any format.
Is there an API for this?
Yes. POST {"code": "..."} to https://api.slideforge.dev/v1/tools/preview-code for the free 1-slide preview, or to /v1/render/code (authenticated) for the full render with signed .pptx and preview URLs — useful for CI or your own tooling. See slideforge.dev/docs/api.
Related: python-pptx limitations and workarounds · Generate PowerPoint in Python · python-pptx vs SlideForge