Octave has a keyboard function that stops the execution of the script and drops you out into an interactive octave shell, so it is possible to inspect variables at that point and carry our other debugging actions.
Is there anything similar in python?