0
点赞
收藏
分享

微信扫一扫

PyQt5开发小软件

洛茄 2022-08-01 阅读 41


PyQt5

可以理解为Qt是C++写的,PyQt只是python封装了C++的接口。所以一般看Qt的文档即可

pip install

Qt Designer

PyQt5开发小软件_封装


PyQt5开发小软件_封装_02


PyQt5开发小软件_python_03


有编辑信号/槽的地方,给按钮增加事件

将.ui的文件转换为.py的文件

pyuic5 -o main_ui.py main.ui

main界面

from PyQt5 import QtWidgets
from main_ui import Ui_Dialog

class mywindow(QtWidgets.QWidget, Ui_SRS):
def __init__ (self):
super(mywindow, self).__init__()
self.setupUi(self)

if __name__=="__main__":
import sys
app=QtWidgets.QApplication(sys.argv)
ui = mywindow()
ui.show()
sys.exit(app.exec_())

发布exe

pip install

pyinstaller --noconsole main.py

可以加-F,只输出一个exe


举报

相关推荐

0 条评论