Thank for all helping and sorry that i overlooked the previous
message.
Peter Hansen wrote:
> [EMAIL PROTECTED] wrote:
> > Should the 'daemonic' flag at setDaemon() function set to 1/TRUE or
> > 0/FALSE to do such action?
>
> First of all, it's "True" and "False" in Python, not TRUE
> and FALSE.
>
To Catch the "SystemExit"
import thread
from time import sleep
import sys
def t1():
try:
i=0
while 1:
print i+1
i += 1
sleep(1)
except SystemExit:
pass
thread.start_new_thread(t1, ())
sleep(3)
This Question was also asked in Python-chinese .
--
http://mail.python.org/mailman/listinfo/python-
Great thank for your helping.
Should the 'daemonic' flag at setDaemon() function set to 1/TRUE or
0/FALSE to do such action?
limodou wrote:
>I think only those threads which invoked with setDaemon() method will
>exit, and others will not, as the main program exit.
--
http://mail.python.org/mail
I think only those threads which invoked with setDaemon() method will
exit, and others will not, as the main program exit.
[EMAIL PROTECTED] wrote:
limodou wrote:
Using Thread's method setDaemon() before you call the start() method.
Just like :
t.setDaemon(True)
t.start()
thank for fast reply.
f
limodou wrote:
>Using Thread's method setDaemon() before you call the start() method.
>Just like :
>t.setDaemon(True)
>t.start()
thank for fast reply.
from python.org doc, said that setDaemon() function as
"The entire Python program exits when no active non-daemon threads
are left."
is it mean that
Using Thread's method setDaemon() before you call the start() method.
Just like :
t.setDaemon(True)
t.start()
[EMAIL PROTECTED] wrote:
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+
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 k