title: How can I kill all threads?
body: <p>In this script:</p>
  
  <pre><code>import threading, socket    
  
  class send(threading.Thread):
  
      def run(self):
          try:
              while True:
                  try:
                      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                      s.connect((url,port))
                      s.send(b"Hello world!")
                      print ("Request Sent!")
                  except:
                      s.close()
          except KeyboardInterrupt:
              # here i'd like to kill all threads if possible
  
  for x in range(800):
      send().start()  
  </code></pre>
  
  <p>Is it possible to kill all threads in the except of KeyboardInterrupt? I've searched on the net and yeah, I know that it has been already asked, but I'm really new in python and I didn't get so well the method of these other question asked on stack.</p>