REPL While It Works: Inspect a Running Python Program Without Pausing It

Usually, without interrupting it, you cannot interactively debug, call functions in, or change the values of variables in a running python program. This article’s technique removes the limitation. There are plenty of python examples showing how an executing script can interrupt its execution to present a console, where you can interact, and then resume execution. Here, the console is your choice of the Python interactive shell prompt, with its Read-Eval-Print Loop (aka REPL), or alternatively, the python PDB debugger. I wanted to do that interacting, but without theinterrupting and the resuming parts. While the long running execution continues to run, and without interrupting the program’s
…