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


Groups > comp.lang.python > #52531

Re: Verifying Variable value

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'debug': 0.07; 'debugging': 0.07; 'calculating': 0.09; 'debugger': 0.09; 'kumar': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'window.': 0.09; 'python': 0.11; 'def': 0.12; 'jan': 0.12; 'breakpoints': 0.16; 'debugger.': 0.16; 'editor,': 0.16; 'ides': 0.16; 'pause': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'variable': 0.18; 'module': 0.19; 'example': 0.22; 'shell': 0.22; 'header :User-Agent:1': 0.23; '(or': 0.24; '---': 0.24; 'values': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; '(which': 0.31; 'code': 0.31; 'that.': 0.31; 'run': 0.32; 'editor': 0.35; 'there': 0.35; 'idle': 0.36; 'method': 0.36; 'step': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'most': 0.60; 'received:173': 0.61; 'manner.': 0.74; 'execution.': 0.84; 'received:fios.verizon.net': 0.84; 'imagine': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Verifying Variable value
Date Wed, 14 Aug 2013 15:08:54 -0400
References <1376475131.60391.YahooMailNeo@web190502.mail.sg3.yahoo.com> <5B80DD153D7D744689F57F4FB69AF4741865E84C@SCACMX008.exchad.jpmchase.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-251-66.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
In-Reply-To <5B80DD153D7D744689F57F4FB69AF4741865E84C@SCACMX008.exchad.jpmchase.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.586.1376507349.1251.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376507349 news.xs4all.nl 15888 [2001:888:2000:d::a6]:36579
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52531

Show key headers only | 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