Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79198
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Subject | Re: How to debug Python IDLE? |
| Date | 2014-10-15 22:21 -0400 |
| References | <f1fbc7fd-0359-4cc1-b71f-7ec9caee0e12@googlegroups.com> <mailman.14891.1413400990.18130.python-list@python.org> <e38339b7-f094-4f52-8e95-522a3fb7f081@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.14911.1413426118.18130.python-list@python.org> (permalink) |
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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to debug Python IDLE? ryguy7272 <ryanshuell@gmail.com> - 2014-10-15 12:09 -0700
Re: How to debug Python IDLE? Terry Reedy <tjreedy@udel.edu> - 2014-10-15 15:22 -0400
Re: How to debug Python IDLE? ryguy7272 <ryanshuell@gmail.com> - 2014-10-15 12:36 -0700
Re: How to debug Python IDLE? MRAB <python@mrabarnett.plus.com> - 2014-10-15 20:52 +0100
Re: How to debug Python IDLE? Terry Reedy <tjreedy@udel.edu> - 2014-10-15 22:21 -0400
Re: How to debug Python IDLE? ryguy7272 <ryanshuell@gmail.com> - 2014-10-15 13:45 -0700
Re: How to debug Python IDLE? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-15 22:19 +0100
csiph-web