title: How to stop a python threading script using a GUI
body: <p>I am using a GUI with a checkbox made with QT and python, when the checkbox is checked i want to display 'stackoverflow' every 5 seconds, when it is unchecked i want it to do nothing. I have tried to call the following function when it is checked:</p>
  
  <pre><code>def work (): 
      threading.Timer(5, work).start ()
      print "stackoverflow"
  
  def checkbox(self, state):
      if state == QtCore.Qt.Checked:
          print 'checked'
          work()
      else: print 'unchecked'
  </code></pre>
  
  <p>But it keeps on printing 'stackoverflow'. How can i stop this?</p>