473,765 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

hello and thanks for reading this,

i have been a dos/windows user using some form of the basic language for 30 years now.
i own and run a small programming company and there is one feature that keeps me in the windows/basic world.

while i will agree that it has not evolved well, it does have one awesome feature that i have yet to see replicated in
any linux product that i know about so far.
i am a long time windows user and have had a great way to learn new api.
to write some code and then run it.
if there is an error, the debugger will load.
then i can figure out what the eror is, just touch up the ocde and continue to run the code.
i do not have to stop the code, modify the code, rerun the code.
often an error will only happen after a complex set of conditions and not have to completely stop the app is a fantastic
way to debug.

there are several applications that can do this.
in fact, the free version of the visual studio 2005, which is free, have this ability.

so how can i use python to debug code and change that code without having to restart the code.

thanks so much,
dave

Nov 8 '05
13 2938
Mike Meyer wrote:
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.


As far as I understand, the OP wanted to do this while single-stepping
through the program he's editing. While this might work as a kind of
exploration, it's probably not an optimal development strategy. It
might be difficult to predict how the program will run the next time
if you manipulate it during execution.

I think test-driven development as described e.g. in my EPC presentation
last year is more rewarding: http://www.thinkware.se/epc2004test/
(See e.g. the log.html)

I suppose different languages and tools foster different styles of
work, and I can understand that it's frustrating if a favoured style
of development isn't really supported by the Python tools--even though
few Python programmers bother about single-stepping through their
code.

In general, it's clearly non-optimal to run code many magnitudes
slower than the nominal speed, and I suspect that few people would
care to do that unless the structure of the code they work with
was messy.

I guess it's a bit like driving an old crappy car, and then getting
into a new Toyota. I can understand that it seems strange not to
have the trunk filled with tools if you're about to take a long trip,
but it's probably a mistake to think that this will make the journey
with the Toyota more problematic than the trip would have been with
a car that you need to repair every now and then.
Nov 10 '05 #11
I used Visual Basic a long time in the past and I know what you mean.

The ability to step through code line by line was very useful in a
language where you often didn't know what was happening. I
particularly loved the ability to hover the mouse over any variable or
expression and see the value at that point in the code.

As a learning tool it would be excellent for Python, as would the
ability to step through the code, hit an error, step back one line,
change the line that caused the error and then continue stepping
forward again.

However I have to say that since using Python, I haven't needed these
features as much (though I still would have liked to have them
available).

Ed

On 08/11/05, python <d@d.com> wrote:
hello and thanks for reading this,

i have been a dos/windows user using some form of the basic language for 30 years now.
i own and run a small programming company and there is one feature that keeps me in the windows/basic world.

while i will agree that it has not evolved well, it does have one awesomefeature that i have yet to see replicated in
any linux product that i know about so far.
i am a long time windows user and have had a great way to learn new api.
to write some code and then run it.
if there is an error, the debugger will load.
then i can figure out what the eror is, just touch up the ocde and continue to run the code.
i do not have to stop the code, modify the code, rerun the code.
often an error will only happen after a complex set of conditions and nothave to completely stop the app is a fantastic
way to debug.

there are several applications that can do this.
in fact, the free version of the visual studio 2005, which is free, have this ability.

so how can i use python to debug code and change that code without havingto restart the code.

thanks so much,
dave

--
http://mail.python.org/mailman/listinfo/python-list

Nov 10 '05 #12
On Wed, 09 Nov 2005 18:04:02 +0000, Steve Holden wrote:
how can such a dynamic language like python not be able to do this.

Do you try to ignore the syntax and grammar of the programming language
you are coding in too, or only English?

That's rather unkind. I'd judge we are plainly dealing with someone who
is working hard to express questions in a foreign language. Funny,
perhaps, but definitely unkind. Take two demerits and smack yourself on
the wrist.


Your judgement is very different from mine. The poster's name is Dave, and
to my eyes his writing is very good English, albeit with lots of typos,
except for refusal to use capital letters where required ("Oh, I'll just
leave out braces in C because I feel like it") and deliberately incorrect
use of punctuation ("I don't feel like using '.' for attribute references,
I'll use '?' instead").

Programmers are supposed to be precise in their use of language --
failure to write what you intend is a bug in natural language just as
much as it is in C, VB, Lisp or Python. It just aggravates me to see
supposedly precise and accurate programmers *deliberately* breaking syntax
and grammar of natural language for no good reason.

(It is, of course, possible to break the rules of natural language for
good reason. Good writers do it all the time.)
there are several applications that can do this.
in fact, the free version of the visual studio 2005, which is free, have this ability.

Just out of curiosity, how much is the free version of Visual Studio 2005?

I'm not positive, but i think they're currently giving it away.


Hmmm... this free version they give away... how much are they giving it
away for?

*wink* (we could keep this up all day...)

--
Steven.

Nov 10 '05 #13
Magnus Lycka <ly***@carmen.s e> writes:
Mike Meyer wrote:
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.
As far as I understand, the OP wanted to do this while single-stepping
through the program he's editing. While this might work as a kind of
exploration, it's probably not an optimal development strategy. It
might be difficult to predict how the program will run the next time
if you manipulate it during execution.


Yes, that's what he wanted. I was pointing out that there are
alternatives between "changing the function while you're debugging it"
and "retyping the function completely at the interactive prompt."
I think test-driven development as described e.g. in my EPC presentation
last year is more rewarding: http://www.thinkware.se/epc2004test/
(See e.g. the log.html)
Depends on what you're doiing. If you know the subject area well
enough that you casn design all the objects and methods in advance so
you can write your unit tests, then this is indeed very rewarding.

If, on the other hand, you are doing something where you don't have a
clear understanding of what all the components are, and how they
interact, then it's more important to try things out to gain that
understanding than it is to have tests for components or methods that
you may well discard or morph beyond recognition tomorrow. The dynamic
nature of Python, coupled with the bundled interactive interpreter,
makes it particularly good for this type of programming.
I guess it's a bit like driving an old crappy car, and then getting
into a new Toyota. I can understand that it seems strange not to
have the trunk filled with tools if you're about to take a long trip,
but it's probably a mistake to think that this will make the journey
with the Toyota more problematic than the trip would have been with
a car that you need to repair every now and then.


Nice analogy.

<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Nov 10 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3271
by: TJ | last post by:
Anyone know how to display process id's (normally found by going to Component Services and switching to applications to 'Status View') in a web page? I'm trying to keep remote users from having to terminal server or use com+ to view the process id's they need for asp debugging (via attaching to a process (remote debugging via dcom and machine debug manager)) Thx in advance,
2
1498
by: orion30 | last post by:
All is in the Object. Is-it possible to modify a window from an another window without having a link Parent To Child ? Thank you
2
1648
by: Baldy | last post by:
Hi All is it possible to modify code at run time? I have a set of constants that change at deployment (from development to deployment server and a few other consts) I have a menu item that prepares the DB for deployment. It does a few other things, re-links tables, tuns of shift key bypass etc. But can I modify the code? do I need to use #if ? thanks
1
1619
by: Dieter Vanderelst | last post by:
Dear all, Could anybody tell me whether there are ways to use an existing DLL file in Python without having access to the source code? I'm trying to find a way to use the image filters available in the Filters-project (http://filters.sourceforge.net/) without having to compile or build the DLL myself, which is according to the authors very hard.
1
9807
by: Primera | last post by:
I have an application that fixes some common problems that prevent the SMS Advanced Client from operating correctly. During this application I need to stop the Windows Management Instrumentation (winmgmt) service, delete the Repository directory, and then restart winmgmt which will then automatically regenerate the Repository directory. Since I am stopping WMI I cannot use System.Management to perform this. I have tried: ...
0
1462
by: =?Utf-8?B?TkVXMi5ORVQ=?= | last post by:
I have a .NET component (VC++) with native C++ at it's core. The native C++ code makes a call to SHFileOperation to delete a directory and it's contents. When I host the .NET component in a VB app, and the SHFileOperation delete is called, the application hangs forever unless I have the "Enable Unmanaged code debugging" project setting on. Note the hang only occurs when I'm running the VB app through the debugger. What gives? Thanks...
17
2119
by: Johnny BeGood | last post by:
Hi All, Is there a way to post the contents of a form without having to click on the Submit button, i.e <form method="post" action="http://www.whereever.com/ProcessTheData.php"> <INPUT name="Field1" type="text"> <INPUT name="Field2" type="text"> <INPUT name="Field3" type="text"> <INPUT name="EsendexRecipient" type="text">
1
5666
by: aj | last post by:
A few service stop/start/restart questions on SQL Server 2005 SP2, which I'll call SQLS. It looks as if there are *potentially* 6 ways to start/stop SQLS Services like the engine itself, integration services, reporting service, Agent.. -SQLS Configuration Manager -SQLS Surface Area Configuration (for Services and Connections) -Mgmt Studio Local (on server)
3
2159
by: DR | last post by:
I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without having to compromise safety in the Sql Server 2005.
0
9566
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8830
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.