#!/usr/bin/python

import sys
from PyQt4 import QtGui
from PyQt4 import QtCore

class Example(QtGui.QWidget):
  def __init__(self):
    super(Example, self).__init__()
    self.initUI()

  def initUI(self):
    qbtn = QtGui.QPushButton('Quit', self)
    qbtn.clicked.connect(QtCore.QCoreApplication.instance().quit)
    qbtn.resize(qbtn.sizeHint())

    self.setGeometry(300, 300, 250, 150)
    self.setWindowTitle('Quit Button')
    self.show()

def main():
  app = QtGui.QApplication(sys.argv)
  ex = Example()
  sys.exit(app.exec_())


if __name__ == "__main__":
  main()


[((22, 8, 22, 36), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', ({(22, 27, 22, 35): 'sys.argv'}, {}), '(sys.argv)', False, 'from PyQt4 import QtGui\n'), ((13, 11, 13, 42), 'PyQt4.QtGui.QPushButton', 'QtGui.QPushButton', ({(13, 29, 13, 35): '"""Quit"""', (13, 37, 13, 41): 'self'}, {}), "('Quit', self)", False, 'from PyQt4 import QtGui\n'), ((14, 25, 14, 59), 'PyQt4.QtCore.QCoreApplication.instance', 'QtCore.QCoreApplication.instance', ({}, {}), '()', False, 'from PyQt4 import QtCore\n')]