See your Python code run, one step at a time.
PythonVx is a desktop app for people who are learning Python β or who have never programmed before. As you type, the right-hand panel redraws your program as a block diagram: every line becomes a block, every variable gets a little box showing its value, and the highlight flows through the blocks line by line, exactly the way Python runs your code. Playback keeps looping until you press pause.
- Code-flow diagram β functions are drawn as blocks with their arguments, classes as dashed blocks around their methods, and
for/while/if/tryblocks get a coloured rail (loops show how many times they ran). Values fly into the variable on the left of=; the values a line reads are shown under each name; calls likelen(x)oracct.deposit(50)show the value they returned;printlines show what they printed andreturnlines show what they returned. - Live while you type β the diagram re-runs a moment after you stop typing. While a line is half-written (a syntax error), the last working diagram keeps playing, dimmed, with the error pinned on top.
- Plays continuously β βΆ / Space starts it, it loops back to the start, and it only stops when you pause (or step manually). The π button turns looping off; speeds go from 0.25Γ to 8Γ.
- Editor highlights β the line that just ran (green) and the line that runs next (yellow), with new values written next to the code.
- Memory tab β every frame and object (lists, dictionaries, your own objects) with arrows showing which names point to the same object.
- Plain-English captions and friendly error messages that explain what went wrong and how to fix it.
- 26 sample programs (variables, loops, functions, recursion, lists, dictionaries, sorting, classes, inheritance, and tours of
math,random,collections,datetime,json,itertools,re,statisticsβ¦) in the Examples menu β also available as plain.pyfiles insamples/.
It works with the whole Python standard library β math, random, datetime, collections, json, re, itertools, functools, statistics, dataclasses, pathlib, asyncio and the rest β because it runs your code with the real Python installed on your computer. Editor autocomplete and hover help are generated from that interpreter too, so every built-in module is covered.
| System | Installer |
|---|---|
| Windows 10/11 | PythonVx_x.y.z_x64-setup.exe or .msi |
| macOS β Apple Silicon (M1βM4) | PythonVx_x.y.z_aarch64.dmg |
| macOS β Intel | PythonVx_x.y.z_x64.dmg |
| Linux | .AppImage, .deb, .rpm |
All installers are on the latest release page.
PythonVx needs Python 3.8 or newer. If you don't have it yet, install it from python.org/downloads β on Windows, tick βAdd python.exe to PATHβ in the installer. PythonVx finds Python automatically (including Homebrew, pyenv, conda and the Windows py launcher). If it can't, open Settings (β) and paste the interpreter's full path.
The app is not notarized by Apple. If macOS says βPythonVx can't be openedβ or βis damagedβ, either right-click the app in Applications and choose Open, or run:
xattr -cr /Applications/PythonVx.appIf SmartScreen shows βWindows protected your PCβ, click More info β Run anyway.
- Write code in the editor on the left, or choose a program from Examples.
- Watch the Code flow panel on the right: it runs automatically and the highlight moves through the blocks as Python executes each line. (Press Run or Ctrl/β + Enter to re-run by hand; turn Auto-run off if you prefer.)
- Pause (Space or βΈ) to look closely, then step with β / β or drag the timeline. Press βΆ to continue β it keeps looping until you pause again.
- If your program uses
input(), type the answers into Program input β one line perinput()call.
| What you see | Meaning |
|---|---|
| Yellow block / editor line | The line Python runs next |
| Green block / editor line | The line that just ran β its new values fly into the boxes |
| Box with a name on top and a value below | A variable and its current value |
Purple box (e.g. len β 3) |
The value a function call returned |
| π¨ chip / β© chip | What that line printed / returned |
for β» 4 |
How many times the loop line has run |
| Dimmed block | Code that hasn't run yet |
| Red marker on the timeline | Where an error happened β click it to jump there |
Every example in the app is a file in samples/, starting with a short header:
# Title: Reading input
# Group: Basics
# Input: Grace|1990 <- optional: answers for input(), separated by |Drop a new .py file with that header into samples/ and it appears in the Examples menu on the next build.
- Python interpreter β auto-detect, or a specific path (with a Test button).
- Maximum steps (default 2000) β long programs are still run to completion so the output is complete, but only the first N steps are recorded.
- Time limit (default 10 s) β stops programs that never finish (e.g.
while True:loops). - Editor font size, inline values, auto-run. Looping and speed are on the toolbar; the zoom of the diagram is in its header.
Files your programs create with relative paths (e.g. open("notes.txt", "w")) are saved in a scratch folder that you can open from Settings. time.sleep() calls are shortened while tracing so you don't have to wait.
βββββββββββββββββ PythonVx desktop app (Tauri) βββββββββββββββββ
β React + Monaco UI ββinvokeβββΆ Rust backend β
β β² β finds Python, starts it β
β β JSON trace βΌ with a timeout β
β βββββββββββββββ python tracer.py run req.json out.json β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- The tracer (
python-visualizer/src-tauri/python/tracer.py, standard library only) compiles your code and runs it undersys.settrace. At every line, call, return and exception it records the call stack, every local variable, and a snapshot of every reachable object (lists, dicts, sets, tuples, named tuples, instances of your classes; anything else βdatetime,Decimal,Path, β¦ β is shown by itsrepr). Identical object snapshots are stored once, so traces stay small. Output,input(),sys.exit(), uncaught exceptions, step and time limits are all handled, and the trace is written to a file so yourprints can never corrupt it. - The Rust backend (
src-tauri/src/lib.rs) locates a Python β₯ 3.8 interpreter, runs the tracer in a private temporary folder (no console window on Windows), enforces a hard timeout, and returns the JSON. It also answers autocomplete questions (βwhat's insidecollections?β) by asking the same interpreter. The tracer also sends the structure of your program (which lines belong to which function, class, loop orif, and the tokens of every line) and records the value of every function call, so the UI can draw the block diagram. - The UI (
src/) β React, Zustand, a locally bundled Monaco editor (works offline) and Framer Motion β turns the trace into the code-flow block diagram (components/FlowView.tsx, indexed bylib/flow.tsso each step renders fast), the editor highlights, captions and the memory view.
Prerequisites: Node.js 18+, Rust (stable, via rustup), Python 3.8+, and the Tauri system dependencies for your OS.
git clone https://github.com/K-692/PythonVx.git
cd PythonVx/python-visualizer
npm install
npm run tauri dev # run the app in development modeBuild the installers for your current platform:
npm run tauri build # output: src-tauri/target/release/bundle/Run the tracer's tests:
python src-tauri/python/test_tracer.pyPushing a version tag builds Windows, macOS (Apple Silicon and Intel) and Linux installers on GitHub Actions and publishes them as a release:
git tag v1.1.1
git push origin v1.1.1The version number lives in python-visualizer/package.json, src-tauri/tauri.conf.json and src-tauri/Cargo.toml.
samples/ example programs shown in the Examples menu
python-visualizer/
βββ src/ React UI
β βββ components/ Toolbar, CodeEditor, FlowView (block diagram), Visualizer, Console, Settings, StatusBar
β βββ lib/ runner (backend calls), flow (diagram indexes), explain (plain-English steps),
β β completions (autocomplete/hover), monacoSetup
β βββ examples.ts loads the sample programs
β βββ store.ts app state
βββ src-tauri/
βββ python/tracer.py the execution tracer (embedded into the app at build time)
βββ python/test_tracer.py tracer tests
βββ src/lib.rs Python discovery, process control, commands
- Only the main thread is traced (code in other threads runs normally but isn't stepped through).
- Code inside library modules isn't stepped into β you see the call and its result.
- GUI toolkits (
tkinter,turtle) and programs that wait for a network or a keyboard won't behave like they do in a terminal. - Your code runs with your user's permissions, just like running
pythonyourself β only run code you trust.
Bug reports and pull requests are welcome β open an issue for anything that looks wrong or confusing, especially explanations that could be clearer for beginners.





