title: PyQt QPushButton signal handling
body: <p>I have a <code>repeat</code> python function and a <em>test.ui</em> which has only one push-button. My doubt is how to loop the same function exactly once for every time the button is clicked. Because for me whenever I perform:</p>
  
  <pre><code>self.pushButton.clicked.connect(self.repeat)
  </code></pre>
  
  <p>it loops many times into the function instead of a single time. I found this by incrementing a value for every time we reach the function. How to reach the function <code>repeat</code> exactly once for every click on the push-button?</p>
  
  <pre><code>import sys
  from PyQt4 import QtCore, QtGui, uic
  
  qtCreatorFile = "test.ui"
  
  Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
  
  
  class Login(QtGui.QMainWindow, Ui_MainWindow):
      i=1
      def __init__(self):
          QtGui.QMainWindow.__init__(self)
          Ui_MainWindow.__init__(self)
  
          self.setupUi(self)
          self.pushButton.setText("iam in init")
          self.pushButton.clicked.connect(self.repeat)
      def repeat(self):
  
          self.pushButton.setText("iam in repeat"+str(self.i))
  
          self.i=self.i+1
  
          self.pushButton.clicked.connect(self.repeat)
  
  
  
  
  if __name__ == "__main__":
      app=QtGui.QApplication(sys.argv)
      main = Login()
      main.show()
      sys.exit(app.exec_())
  </code></pre>