title: wait for user action to continue code execution
body: <p>Here is my code:</p>
  
  <pre><code>from PySide.QtGui import *
  
  class window_A(QWidget):
      def __init__(self):
          super(window_A, self).__init__()
          layout = QVBoxLayout() # Create horisontal layout
          self.setLayout(layout) # Use horisontal layout to place widgets in window
          self.resize(300,50) # resize window
  
          self.button_A = QPushButton('PRESS')
          self.button_A.clicked.connect(self.func)
          self.button_A.clicked.connect(self.close)
          layout.addWidget(self.button_A)
  
      def func(self):
          print 'A'
  
  
  app = QApplication([])
  
  print 'BEFORE'
  widget = window_A()
  widget.show()
  print 'AFTER'
  
  app.exec_()
  </code></pre>
  
  <p>How can I hold the execution of code after showing the window until the user will press the button? E.g. print 'AFTER' only after button pressed and window closed.</p>