[Tutor] Repeat function until...

Sithembewena Lloyd Dube zebra05 at gmail.com
Wed Jun 23 21:52:37 CEST 2010


My code has two bugs. If any command other than an int is entered, it falls
over ungracefully. Also, if any integers other than 1 or 0 are entered
successively it exits the Python interpreter.

I thought I would point this out so as not to mislead the OP.

On Wed, Jun 23, 2010 at 8:09 PM, Alan Gauld <alan.gauld at btinternet.com>wrote:

>
> "Steven D'Aprano" <steve at pearwood.info> wrote
>
>> The easiest way is to just run forever, and stop when the user interrupts
>> it with ctrl-D (or ctrl-Z on Windows):
>>
>
> I think that would be Ctrl-C on both.
> Ctrl-D/Z is EOF not Interrupt. Certainly on Windows Ctrl-Z won't interrupt
> a loop.
>
> But the principle is good and definitely the easiest option.
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100623/be8eddf1/attachment.html>


More information about the Tutor mailing list