Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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; 'else:': 0.03; 'subject:IDLE': 0.04; 'syntax': 0.04; 'anyway.': 0.05; 'subject:Python': 0.06; 'debugging': 0.07; 'debugger': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:How': 0.10; 'def': 0.12; 'jan': 0.12; 'background.': 0.14; "wouldn't": 0.14; '"is': 0.16; 'indent': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply- To:1': 0.27; 'on,': 0.29; 'code': 0.31; 'factor': 0.31; 'this.': 0.32; 'run': 0.32; 'another': 0.32; 'quite': 0.32; 'running': 0.33; 'comment': 0.34; "can't": 0.35; 'display': 0.35; 'case,': 0.35; 'editor': 0.35; 'idle': 0.36; 'subject:?': 0.36; 'should': 0.36; 'checks': 0.38; 'window': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'blank': 0.60; 'tell': 0.60; 'break': 0.61; 'box,': 0.64; 'anything.': 0.68; 'attention': 0.75; 'click': 0.77; 'saw': 0.77; 'received:fios.verizon.net': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: How to debug Python IDLE? Date: Wed, 15 Oct 2014 22:21:34 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-108-16-203-145.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413426118 news.xs4all.nl 2855 [2001:888:2000:d::a6]:45652 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79198 On 10/15/2014 3:36 PM, ryguy7272 wrote: Please pay attention to Mark's comment about how to avoid blank line doubling. > def showMaxFactor(num): > count = num / 2 > while count > 1: > if num % count == 0: > print 'largest factor of %d is %d' % \ > (num, count) > break > count -= 1 > else: > print num, "is prime" > for eachNum in range(10, 21): > showMaxFactor(eachNum) > > With the debugger ON, I hit F5 and get this. > 'Expected an indent block' You saw that in a Syntax Error box. > I wouldn't say that's debugging anything. Quite the opposite. Idle checks syntax before running the code since running the code would produce the same error anyway. > I can't tell what line is throwing the error, or how to fix it. When you click OK on the box, the editor window is display with the error marked in red background. In this case, that should be 'print' with red background. If you indent print and run again, you should, if running 3.x, see 'Missing parenthesis...' and another red marking. -- Terry Jan Reedy