title: How to terminate a thread in Python without loop in run method?
body: <p>Having class which has a long method.<br>
  Creating a thread for that method.<br>
  How i can kill\terminate this thread?<br>
  Main problem is that i can't check for <strong>threading.Event</strong> in thread <strong>run()</strong> method because it doesn't contain loop.<br>
  Similar code as here:</p>
  
  <pre><code>import time
  import threading
  
  class LongAction:
      def time_consuming_action(self):
          tmax = 600
          for i in range(tmax):
              print i
              time.sleep(1)
          time.sleep(tmax)
          self.tmax = tmax
          return "Slept well"
  
  class LongActionThread(threading.Thread):
      def __init__(self, la_object):
          self.la = la_object
          threading.Thread.__init__(self)
  
      def run(self):
          self.la.time_consuming_action()
  
  
  la = LongAction()
  la_thread = LongActionThread(la)
  la_thread.start()
  
  # After 5 sec i've changed my mind and trying to kill LongActionThread
  time.sleep(5)
  print "Trying to kill LongActionThread"
  la_thread.kill()
  </code></pre>