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; 'subject:Python': 0.06; 'debug': 0.07; 'debugging': 0.07; 'wednesday,': 0.07; 'debugger': 0.09; 'oh,': 0.09; 'works.': 0.09; 'subject:How': 0.10; 'python': 0.11; 'def': 0.12; 'jan': 0.12; "wouldn't": 0.14; '"is': 0.16; 'debugger.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'indent': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'reedy': 0.16; 'thoughts?': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'print': 0.22; 'load': 0.23; 'header:User-Agent:1': 0.23; 'looks': 0.24; '15,': 0.26; 'code:': 0.26; 'url:edu': 0.26; 'header:In- Reply-To:1': 0.27; 'wondering': 0.29; 'on,': 0.29; "i'm": 0.30; 'code': 0.31; "skip:' 10": 0.31; 'that.': 0.31; 'factor': 0.31; 'ok.': 0.31; 'though.': 0.31; 'file': 0.32; 'this.': 0.32; 'run': 0.32; "can't": 0.35; 'something': 0.35; 'editor': 0.35; 'but': 0.35; 'controls': 0.36; 'idle': 0.36; "didn't": 0.36; 'subject:?': 0.36; 'wrong': 0.37; 'turn': 0.37; 'mine': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'above,': 0.60; 'tell': 0.60; 'break': 0.61; 'first': 0.61; 'anything.': 0.68 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=V9zz0IXi c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=m9fHe4oz-9sA:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=hhu7GyL-AAAA:8 a=uqwTng8wSHPb4UPlldMA:9 a=lUr9miTXkPgISOQD:21 a=Ahm8MFmaPjulln4V:21 a=QEXdDO2ut3YA:10 a=Xm71Ff32JaoA:10 X-AUTH: mrabarnett:2500 Date: Wed, 15 Oct 2014 20:52:17 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: How to debug Python IDLE? References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: 62 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413402739 news.xs4all.nl 2836 [2001:888:2000:d::a6]:53068 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:79179 On 2014-10-15 20:36, ryguy7272 wrote: > On Wednesday, October 15, 2014 3:23:22 PM UTC-4, Terry Reedy wrote: >> On 10/15/2014 3:09 PM, ryguy7272 wrote: >> >> > I'm wondering how to debug code in IDLE Python 3.4. I found this. >> >> >> >> Use 3.4.2, which has an important bugfix for debugger. >> >> >> >> > http://www.cs.uky.edu/~paulp/CS115F11/notes/debug/debug.html >> >> > >> >> > That looks pretty helpful, >> >> >> >> > but mine is nothing like that. All my controls are greyed out. >> >> >> >> That is normal when you first turn debugger on. You have to load a file >> >> in the editor and then run it (F5). On the site above, the file is >> >> volume.py. The the debugger is 'activated'. >> >> >> >> -- >> >> Terry Jan Reedy > > > Oh, I didn't know that's how it works. ok. Makes sense. Something is still wrong though. I have a file named 'test_script.py'. > > Here's the code: > > 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' > > I wouldn't say that's debugging anything. I can't tell what line is throwing the error, or how to fix it. > > Any thoughts? > The 'print' line is indented the same as the 'if' line.