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_())