pyqt5 hello world

Solutions on MaxInterview for pyqt5 hello world by the best coders in the world

showing results for - "pyqt5 hello world"
Lisa
21 Mar 2018
1import sys
2from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
3
4# you can copy and run this code
5
6class MainWindow(QMainWindow):
7    def __init__(self, parent=None):
8        super(MainWindow, self).__init__(parent)
9        self.setWindowTitle("Hello World")
10        label = QLabel("Hello World", self)
11        
12        self.show()
13
14if __name__ == "__main__":
15    app = QApplication(sys.argv)
16    window = MainWindow()
17    sys.exit(app.exec_())