I am using python 2.4 and trying to debug a twisted application.
Is there any way by which I can perhaps put a watch on an object开发者_Go百科 and break execution when its value changes.
For Example
To start with A.state="connected" What I want is a notification or pause in execution when A.state changes its value.
I am new to pdb and twisted so if you feel this question needs more info, I can provide it.
Yes, take a look here:
- http://docs.python.org/library/pdb.html
Here is a more detailed answer. python: in pdb is it possible to enable a breakpoint only after n hit counts?
If state
is a property of A
with a setter method, then you can set a break point inside its setter method and the execution will break whenever there is an attempt to change it.
精彩评论