safest way to kill a thread

martinnitram at excite.com martinnitram at excite.com
Tue Jan 18 22:48:17 EST 2005


Dear all,
in python, a thread can be created by t = threading.Thread. But i
found that when the main (and the thread) program is running and user
use Crtl+C/Crtl+Z to break the program abnormally, the thread is still
running and needed to kill manually (by the pid). Is there had any
safest way to kill/exit the thread program under python (when the
thread program part is a forever loop)?

    Thank a lot




More information about the Python-list mailing list