pip install pyqt5 python import sys from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QPushButton python class MyWindow(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): layout = QVBoxLayout() button.clicked.connect(self.buttonClicked) label = QLabel() layout.addWidget(button) layout.addWidget(label) self.setLayout(layout) def buttonClicked(self): if __name__ == "__main__": app = QApplication(sys.argv) window = MyWindow() window.show() sys.exit(app.exec_())


上一篇:
下一篇:
切换中文