Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52531

Re: Verifying Variable value

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Verifying Variable value
Date 2013-08-14 15:08 -0400
References <1376475131.60391.YahooMailNeo@web190502.mail.sg3.yahoo.com> <5B80DD153D7D744689F57F4FB69AF4741865E84C@SCACMX008.exchad.jpmchase.net>
Newsgroups comp.lang.python
Message-ID <mailman.586.1376507349.1251.python-list@python.org> (permalink)

Show all headers | View raw


On 8/14/2013 12:36 PM, Prasad, Ramit wrote:
> chandan kumar wrote:

>> Is there a way to validate variable values while debugging any python code.
> In addition to pdb, I would imagine most Python IDEs would support debugging in this manner.

Idle also has a debugger. It uses the same bdb base debug module as pdb. 
One turns it on (or off) in the Shell window. Then run code from an 
editor window. For your example (which lacked the ':')
---
def method():
   a = 20
   b =30
   c =  a + b
   return

method()
---
I added the return so the debugger would pause there after calculating 
c. The method has to be called in order to step into the body during 
execution. One can also set breakpoints in the editor, though I have 
never tried that.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Verifying Variable value Terry Reedy <tjreedy@udel.edu> - 2013-08-14 15:08 -0400

csiph-web