title: stop threads when exception happen
body: <p>I have 10 threads, the problem is when something wrong happens raising the exception, <code>bye</code> will be printed 10 times.</p>
  
  <p>I just want to print it once, then terminate all the threads. Is there any solution for the problem?</p>
  
  <pre><code>from threading import Thread
  def printmsg(msg,threadNumber):
      while True:
          try:
              print 'this is your message %s -- Thread Number:%s'%(msg,threadNumber)
          except:
                exit('Bye')
  
  for i in range(0,11):
      Thread(target=printmsg,args=('Hello Wrold',str(i))).start()
  </code></pre>