Pyringe
Debugger capable of attaching to and injecting code into python
...It blends debugger-style attachment (via gdb/ptrace techniques) with Python-aware helpers so you can inspect threads, frames, locals, and heap objects without restarting the target. This is invaluable for post-mortem diagnosis of production daemons where reproducing a bug in a dev shell is impractical. pyringe can inject arbitrary Python into the target process, enabling on-the-spot logging, state dumps, or gentle patching to keep a system limping along while you gather evidence. It’s also useful for forensic snapshots: enumerate objects of a certain type, find reference cycles, or measure memory pressure without pre-instrumentation. ...