[wingide-users] How to simulate python -i myscript.py, using debugger

Wingware Support support at wingware.com
Wed Sep 20 13:51:35 MDT 2006

On Wed, 20 Sep 2006, Tony Cappellini wrote:
> I need to run a script, so that the interpreter stays running after the the
> script has ended. (aka python -i).
> Can this be done within the Wing IDE?
> I know there is an interactive shell and debug probe, but it's not quite the
> same.
> I have a breakpoint set in the first line of a function, and I want to trace
> through it.
> I've set a breakpoint just before the script exits. When I go to Debug Probe
> and call my function, it executes, not with the debugger.

You could do this by importing wingdbstub into your script and 
running it from the command line with python -i.  Also set the 
flag kEmbedded=1 in your copy of wingdbstub that you use (best to 
make an actual copy, don't edit the one in your Wing installation 
directly).  Without this the debug connection will drop before 
you reach the Python prompt.

As long as you set your breakpoints before starting python -i it 
will work and stop and breakpoints reached from the typed 

The problem with this is that setting or removing breakpoints 
doesn't work well while at the Python prompt because our code is 
not getting any time to service the network connection.  
However, if you're already stopped at a breakpoint then it will 
work fine.  This can be annoying but in practice usually can be 
worked around.

More details on external launch debugging are here:


In the future we want to change Debug Probe to reach breakpoints.  
The fact that it doesn't right now is an unfortunate limitation.

Hope that helps.  Please let me know if you have trouble with it.

Stephan Deibel

Wing IDE for Python
Advancing Software Development


More information about the wingide-users mailing list