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.ga...@btinternet.com>wrote: > > "Steven D'Aprano" <st...@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@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > -- Regards, Sithembewena Lloyd Dube http://www.lloyddube.com
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor