Follow a Python program one line at a time.
A small browser workbench for watching loops, variables, and printed output as they change.
Write or edit a short Python snippet, run it, and move through the trace at your own pace. The active line gets an arrow; changed values get a before-and-after view.
- Step through execution with the timeline controls or by selecting a trace row.
- Keep state in view with local variables and printed output beside the code.
- Read a quick note about the line Python is running.
- Switch themes without losing your preference on the next visit.
- Run it in your browser. The app has no application server and does not upload your snippet.
The first run downloads Pyodide from jsDelivr, so an internet connection is needed to start the Python runtime.
Open How to read this in the app for a short walkthrough, or read its source in guide.mdx.
You’ll need Node.js 24 or newer and pnpm 10.
pnpm install
pnpm --filter @workspace/python-visualizer run devVite starts the visualizer on port 5173. To check the build and types:
pnpm --filter @workspace/python-visualizer run typecheck
pnpm --filter @workspace/python-visualizer run buildThe interface is React and TypeScript, bundled with Vite. Python runs in the browser through Pyodide. A small sys.settrace hook records executed lines, visible local values, and standard output for the timeline.
This is meant for short examples, not as a replacement for a full IDE. Long-running code can leave the browser tab busy.
| Path | What lives there |
|---|---|
artifacts/python-visualizer/src/App.tsx |
Editor, Python trace, and main workspace |
artifacts/python-visualizer/src/content/guide.mdx |
In-app walkthrough |
artifacts/python-visualizer/src/pages/guide.tsx |
Guide page layout |
artifacts/python-visualizer/src/index.css |
Light and dark themes, responsive layout |