thread end and make main program end also?

martinnitram at martinnitram at
Thu Mar 10 07:40:34 CET 2005

Dear all,

   Following are some codes:

   from myClass import * # some user define classes, which will catch
the exception within its function

      myClass myclass
      while (1):
         returnValue = myclass.myfunction();
         print "Return Value %s" % returnValue
      #... cont' to do something

    # main
    thrd =  threading.Thread(None,thread_function,"thread_function")
    #... cont' to do other thing

    'myClass.myfunction()' will return some value (used 'return') when
caught exceptions and let the 'thread_function()' handle the following.
But now found that after 'myClass.myfunction()' return, both thread
program and main program will exit, when i prefer it will cont' to run.

     is it the default behavior of thread return? Thank a lot

More information about the Python-list mailing list