Answers for "pyqt5 hello world example"

1

pyqt5 hello world

import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel

# you can copy and run this code

class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setWindowTitle("Hello World")
        label = QLabel("Hello World", self)
        
        self.show()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    sys.exit(app.exec_())
Posted by: Guest on December-05-2020

Python Answers by Framework

Browse Popular Code Answers by Language