how to modify code while debugging it without having to stop and then restart debugger

Mike Meyer mwm at mired.org
Wed Nov 9 15:22:16 EST 2005


Steve Holden <steve at holdenweb.com> writes:
> Steven D'Aprano wrote:
>> On Tue, 08 Nov 2005 13:38:28 -0500, python wrote:
> [...]
>>>as i mentioned even micro$soft can do this using statically type languages like visual basic and csharp.
>>> also, both visualbasic and csharp have goto statements, which i do
>>> to not use in final code but can be real handy when used with the
>>> ability to change debugged code on the fly while inside the
>>> function being debugged.
>> Better and better. Yes, I can see how the ability to jump around a
>> function on the fly would really help you understand how the function is
>> supposed to work when you take the gotos out.
> I must admit I had been wondering just how far the OP wanted to go in
> mangling the code. I suspect that the interesting bit to the OP is
> having a visual editor available to alter functions and class
> definitions "on the fly" rather than having to completely re-enter the
> definition as you would at the interactive interpreter prompt. He or
> she'd probably be a bit unhappy about the need to reload() modules
> too, I suppose.

In that case, you're using the wrong IDE. I run the Python interpeter
inside of Emacs. I edit my code in another buffer. In the source code
buffer, I hit M-C-x, and the current version of the function I'm
currently editing gets sent to the interpreter. Reload is pretty easy
as well - C-c RETURN, and the module I'm editing gets reloaded.

   <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list