from PyQt4 import QtCore, QtGui import sys from ui import KPMainWindow def run_koopatlas(): global Koopatlas Koopatlas = KPApplication(sys.argv) Koopatlas.run() class KPApplication(QtGui.QApplication): def run(self): self.mainWindow = KPMainWindow() self.mainWindow.show() self.exec_()