title: How to make the code wait till the button is pressed in PyQt
body: <p>So this is a short version of what I have but basically serving the same purpose:</p>
  
  <pre><code>import sys
  from PyQt4 import QtGui, QtCore
  
  def __init__(self):
      super(PyQt, self).__init()
      self.gridLayout = QtGui.QGridLayout()    
      self.setGeometry(200,200,200,200)
  
      self.Enter = QtGui.QPushButton("Enter")
      self.gridLayout.addWidget(self.Enter,1,0,0,0)
      self.Enter.clicked.connect(self.buttonOK)
  
      self.lineEdit = QtGui.QLineEdit()
      self.gridLayout.addWidget(self.lineEdit,0,0,0,0)
  
  def buttonOK(self):
  
      # if statement checking if lineEdit.is_int() == False
      question = QtGui.QMessageBox.question(self, "The value that you entered is not a whole number. Please enter again", QtGui.QMessageBox.OK | QtGui.QMessageBox.Ignore)
          if question == QtGui.QMessageBox.OK
              # Make the code wait for "Enter" button is pressed again
  </code></pre>
  
  <p>How would I go about making the code wait till the Enter button is pressed again, then make it run buttonOk again?</p>