Inspired by Pyinjector, Stitch lets you inject Python code to any running Python process and execute code inside it in real time. Pick a process, connect, and start injecting Python code.
Stitch finds Python processes running on your machine, attaches to one, and opens a live channel into it. From there you can execute any Python code and see the output immediately.
- Automatically finds running Python processes and shows which version they're using
- Live code execution.
- Script folder with support for custom
.pyfiles. - Create new scripts directly from the UI
- No dependencies required on the target machine, Stitch uses the Python interpreter already running in the process
Grab the latest stitch.exe from the Releases page, or build it yourself from source.
You'll need Rust installed.
git clone https://github.com/dexvnd/stitch.git
cd stitch
cargo build --releaseThe build script compiles the stub DLL and embeds it into stitch.exe automatically.
- Start a Python process (any script, app, or just
pythonin a terminal) - Launch
stitch.exe - Select the process from the list on the left and click Connect
- Type or load a script and click Execute
When you connect to a python process Stitch injects a small stub into the target process using the standard Windows loader API. The stub initialises the CPython runtime inside the target, connects back to Stitch over a named pipe. Reading code, executing it under the GIL, and sending the output back. The pipe stays open so you can keep sending code without reconnecting.
The whole thing is written in Rust. The stub is a cdylib target in the same workspace, compiled separately and the injection and UI are in the main binary.
stitch/
├── src/
│ ├── main.rs entry point
│ ├── app.rs egui UI
│ ├── lib.rs stub DLL
│ ├── python.rs CPython API resolved at runtime
│ ├── pipe.rs named pipe for communicating between exe and stub
│ ├── injector.rs loads the stub into the target process
│ └── process.rs enumerates and filters Python processes
Project idea and name by Body-Alhoha.
MIT — see LICENSE for details.
