title: PyQt5 QTimer count until specific seconds
body: <p>I am creating a program in python and i am using pyqt. I am currently working with the QTimer and i want to print "timer works" every seconds and stop printing after 5 seconds. Here is my code:</p>
  
  <pre><code>timers = []
  def thread_func():
      print("Thread works")
      timer = QtCore.QTimer()
      timer.timeout.connect(timer_func)
      timer.start(1000)
      print(timer.remainingTime())
      print(timer.isActive())
      timers.append(timer)
  
  def timer_func():
      print("Timer works")
  </code></pre>