Skip to content

Instantly share code, notes, and snippets.

@srcrip
Created March 2, 2017 03:59
Show Gist options
  • Save srcrip/253c52104deb4ab38beadb255bc702e6 to your computer and use it in GitHub Desktop.
Save srcrip/253c52104deb4ab38beadb255bc702e6 to your computer and use it in GitHub Desktop.
PyQt Starter
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from design import Ui_MainWindow
class App(Ui_MainWindow):
def __init__(self, MainWindow):
Ui_MainWindow.__init__(self)
self.setupUi(MainWindow)
# Connect a widget
self.pushButton.clicked.connect(self.func)
def func():
print ("Test")
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
mw = QtWidgets.QMainWindow()
prog = App(mw)
mw.show()
sys.exit(app.exec_())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment