title: How to terminate thread in python
body: <p>Here I am creating 3 threads for one server and 2 clients. I wanted to stop the thread and make the port numbers reusable after one execution. My code is</p>
  
  <pre><code>t1=threading.Thread(target=serv)
  t2=threading.Thread(target=cli1)
  t3=threading.Thread(target=cli2)
  
  t1.start()
  time.sleep(2)
  t2.start()
  time.sleep(2)
  t1.start()
  time.sleep(2)
  </code></pre>
  
  <p>Here <code>serv</code>, <code>cli1</code> and <code>cli2</code> are the functions that contains client server programs.</p>
  
  <p>How do I terminate these threads ?</p>