Dan M wrote:
>>2) Anybody know how to alter the "while 1: pass" section to make the
>>app stoppable?
> 
> 
> That one I think I can help with! See below.
> 
> 
>>    while 1: pass
> 
> 
>       try:
>         while 1:
>               pass
>       except KeyboardInterrupt:
>         break

That might make it "stoppable" (or at least more cleanly stoppable than 
it is now) but it doesn't make it efficient.

Adding something like "time.sleep(0.1)" in place of "pass" is 
advisable... or the main thread will be "busy-waiting", using up CPU 
time, while waiting for Ctrl-C...

-Peter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to