How to cleanly pause/stop a long running function?

Michael Tobis mtobis at gmail.com
Sat May 12 23:43:59 EDT 2007


> Doing a Ctrl+C
> interrupt would be a not-so-clean-way of performing such a thing, and
> it would quit the application altogether. I'd rather have the function
> return a status object of what it has accomplished thus far.

Just in case you are unaware that you can explicitly handle ^C in your
python code, look up the KeyboardInterrupt exception.

mt




More information about the Python-list mailing list