pip install PyQt5
pip install PyQt5-tools
在路径下venv\Lib\site-packages\pyqt5_tools\Qt\bin找到designer.exe
life2coding.py
import sys from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QApplication,QDialog from PyQt5.uic import loadUi class Life2Coding(QDialog): def __init__(self): super(Life2Coding,self).__init__() loadUi('life2coding.ui',self) self.setWindowTitle('Life2Coding PyQt5 Gui') self.pushButton.clicked.connect(self.on_pushButton_clicked) @pyqtSlot() def on_pushButton_clicked(self): self.label1.setText('welcome:'+self.lineEdit1.text()) app=QApplication(sys.argv) widget=Life2Coding() widget.show() sys.exit(app.exec_())
标签:__,Life2Coding,self,PyQt5,sys,import,安装 From: https://www.cnblogs.com/reaptem/p/11733435.html