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

Tony Cappellini cappy2112 at gmail.com
Wed Sep 20 19:07:52 MDT 2006

I've done all of these.

I was able to set a breakpoint in my function, and the debugger would break
there, when I called my function from the Debug Probe window.

However, successive attempts at to do this didn't work. That is, the IDE
would only break once, even if I called my function several times, or
exited the IDE, exited the script at the commandline, restarted the IDE
(breakpoints set), and restarted the script via python -i script.py

We're getting close. This is a very cool feature.

On 9/20/06, Wingware Support <support at wingware.com> wrote:
> 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
> commands.
> 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:
> http://wingware.com/doc/debug/debugging-externally-launched-code
> 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
> --
> Wingware
> Wing IDE for Python
> Advancing Software Development
> www.wingware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20060920/79ad2d3a/attachment.html

More information about the wingide-users mailing list