petitpy in the browser

petitpy is a small Python runtime written in Zig. Here it is compiled to wasm32-wasi and runs in your browser through @bjorn3/browser_wasi_shim. Python does the computation; JavaScript does the rendering. Everything below runs locally, with no server. The documentation covers the runtime itself.

Playground

Write Python, right here

An editor, a Run button, and the bytecode the compiler produced: the string table, the constants, then the opcodes for each scope. Load any corpus program known to run on wasm, or paste your own.

run & disassemble →
Games

Play something

Six classics (Snake, Catch, Breakout, 2048, Tetris, Space Invaders), each written three ways: kid (Python, no classes), pro (Python, classes + decorators), js (JavaScript). Plus a memory-match demo that shows clicks + sound + collision helpers.

19 playable variants →
Demos

See what Python can do

Twelve interactive showcases: a Python REPL, a snippet runner, form validation, a sales dashboard, a Lotka-Volterra simulator, Conway's Game of Life, a markdown editor, reaction-diffusion, TodoMVC, a Pomodoro timer, a calculator, a color picker.

12 demos →
Extensions

Beyond the page

Browser extensions and offline projects built on petitpy. Currently one: Nano Build Monitor, a Chrome/Firefox extension that watches CI builds across Sourcehut, GitHub, and GitLab, with all its logic in Python.

1 extension →