PyRoo — Quokka-style Live Python Evaluation
See your Python run as you type. PyRoo turns any ordinary .py file into a
live scratchpad: it reruns your code shortly after every edit and shows
variable values, expression results, print() output, and runtime errors
inline, right beside the lines that produced them.
x = 5 # x = 5
y = x * 2 # y = 10
x + y # ⇒ 15
greeting = f"hello {x}" # greeting = 'hello 5'
print(greeting) # ▸ hello 5
for i in range(10): # i = 0, 1, 2, …, 9 (×10)
total = i * i # total = 0, 1, 4, …, 81 (×10)
result = 1 / 0 # ✖ ZeroDivisionError: division by zero
Great for learning Python, exploring an idea, or testing a snippet without
ever leaving the editor or touching a terminal.
Features
- Live values — assignments, tuple unpacking,
+=, loop variables,
with/except bindings, bare expressions, and return values, all inline.
- Loop timelines — see the first values and the last one, with a count:
i = 0, 1, 2, …, 99 (×100). Hover for details.
- Print output on the right line — even for
print() calls inside
functions. Full output in the "PyRoo" output channel.
- Errors where they happen — the exception message lands on the failing
line; hover for the full traceback.
- Edit-friendly — while your code is mid-edit and doesn't parse, the last
good results stay visible instead of flickering away.
- Safe by default — infinite loops are stopped by a watchdog (default 5 s)
that still reports partial results; output and recorded values are capped;
superseded runs can never overwrite newer results.
- Your interpreter — uses the environment selected in the VS Code Python
extension (or
pyroo.pythonPath, or python3). Virtualenvs just work.
- Zero dependencies — the runner is pure Python stdlib; nothing is
installed into your environment.
Quick start
- Open a saved
.py file.
Cmd/Ctrl+Shift+P → PyRoo: Start on Current File.
- Type. Annotations appear ~300 ms after you pause.
Commands
| Command |
What it does |
PyRoo: Start on Current File |
Start live evaluation (also resumes after pause) |
PyRoo: Pause |
Stop auto-rerunning; keeps current annotations |
PyRoo: Rerun Now |
Force a run immediately |
PyRoo: Stop |
Stop and clear all annotations |
The status bar item shows PyRoo's state; clicking it reruns.
Settings
| Setting |
Default |
Description |
pyroo.pythonPath |
"" |
Interpreter to use; empty = Python extension's choice, then python3 |
pyroo.timeoutMs |
5000 |
Max run time before the watchdog stops the run |
pyroo.debounceMs |
300 |
How long to wait after typing stops |
pyroo.maxInlineLength |
120 |
Inline annotation length limit (hover for more) |
How it works
PyRoo instruments your file's AST (inserting tiny reporting calls after
assignments and around expressions), runs it in a subprocess with your chosen
interpreter, and streams one JSON report back to the editor. print output is
attributed to source lines by inspecting the call stack. Your code itself is
never modified on disk.
Things to know
- The whole file reruns on every pause in typing. Don't point PyRoo at
code with side effects you wouldn't want repeated (file writes, API calls,
sending emails…). There is no sandboxing.
- One file at a time; imports of sibling
.py files in the same folder work.
- The file must be saved once before starting (untitled buffers aren't
supported yet).
input() raises EOFError — there is no interactive stdin.
- Assignments to attributes/subscripts (
obj.x = 1, d[k] = v) run fine but
aren't annotated yet.
Development
npm install
npm run compile # build the extension
python3 tests/test_runner.py # runner test suite
npm run package # build the .vsix
Or open the repo in VS Code and press F5 for an Extension Development Host.
See PROJECT.md
for goals, design decisions, and the roadmap.
Acknowledgements
PyRoo is inspired by the excellent Quokka.js by
Wallaby.js. PyRoo is an independent project and is not affiliated with,
endorsed by, or connected to Wallaby.js or Quokka.js in any way.
License
MIT