#!/usr/bin/python import sys from qt import * a = QApplication(sys.argv) b = QPushButton("spam", None) a.setMainWidget(b) b.show() a.exec_loop()