Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'python,': 0.02; 'debugging': 0.07; 'ex:': 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; 'python': 0.11; 'def': 0.12; 'times,': 0.14; 'posted': 0.15; 'printing.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'superfluous': 0.16; 'throw': 0.16; 'unequal': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'example': 0.22; 'print': 0.22; 'header:User- Agent:1': 0.23; "haven't": 0.24; 'post': 0.26; 'values': 0.27; 'header:X-Complaints-To:1': 0.27; '0);': 0.29; 'mode': 0.30; 'statement': 0.30; 'code': 0.31; 'assert': 0.31; 'fault': 0.31; 'option)': 0.31; 'option': 0.32; 'text': 0.33; 'rgb(0,': 0.33; 'but': 0.35; 'there': 0.35; 'consistent': 0.36; 'to:addr:python- list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'most': 0.60; 'new': 0.61; "'times": 0.64; 'talking': 0.65; 'mail,': 0.68; 'loses': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: Verifying Variable value Date: Wed, 14 Aug 2013 12:01:58 +0000 (UTC) References: <1376475131.60391.YahooMailNeo@web190502.mail.sg3.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 174.32.174.30 User-Agent: XPN/1.2.6 (Street Spirit ; Linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376481740 news.xs4all.nl 16002 [2001:888:2000:d::a6]:56876 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52509 chandan kumar wrote: > Hi , > > Is there a way to validate variable values while debugging any python code.Run below example  in debugging mode and i would like to know the value of c (I know print is an option) with any other option other than printing. > In C# or some other tools we can verify each statement and values. Is there way to check each statement in python code like in c#. > > Ex: > def method() >   a = 20 >   b =30 >   c =  a + b I haven't used the language called C# since before it was renamed. But if they were at all consistent to its forbears, you must be talking about assert(). assert() works pretty much the same in Python, though you don't need the parens. assert c==50 will throw an AssertionError if c is unequal to 50 > >
Hi ,

Is there a way to validate variable values while debugging any python code.Run below example  in debugging mode and i would like to know the value of c (I know print is an option) with any other option other than printing.