[Tutor] new bie help

Tim Peters tim_one@email.msn.com
Thu, 26 Aug 1999 01:06:52 -0400


[webby armstrong]
> the other weird occurance was that I was unable to turn off the
> command line mode or even continue after entering this script:
>
> >>> while 1:
> ...       pass # Busy-wait for keyboard interrupt

[Joseph J. Strout]
> This is an infinite loop.  The "keyboard interrupt" it's waiting for
> very busily is a control-C on most machines, or a command-period on
> the Mac.

If webby was running this under IDLE, the control-C would never be seen -- Tk
takes over the keyboard, so Python doesn't see the control-C until Tk passes it
on, but Tk never gets a chance to run because Python is too busy running the
loop.

The solution is simple:  don't run infinite loops under IDLE <wink>.

decent-advice-even-outside-of-idle-ly y'rs  - tim