使用cx_freeze打包pyqt4程序为exe
作者:互联网观察 发布时间:Jun 23, 2011 分类:技术
pyQt源程序exam1.py: #!/usr/bin/env python import sys,sip !!sip是Qt要求的,必须加 from pyQt4 import QtGui,QtCore class MyWidget(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setFixedSize(200, 120) self.quit = QtGui.QPushButton("Quit", self) self.quit.setGeometry(62, 40, 75, 30) self.quit.setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold)) self.connect(self.quit, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()")) app = QtGui.QApplication(sys.argv) widget = MyWidget() widget.show() sys.exit(app.exec_()) 打包命令: D:\liusp\study\pyQT\exams>d:\cx_Freeze-3.0.3\FreezePython.exe --shared-lib-name=d:\Python25\lib\site-packages\PyQt4\QtCore4.dll --shared-lib-name=d:\Python25\lib\site-packages\PyQt4\QtGui4.dll --shared-lib-name=d:\python25\lib\site-packages\PyQt4\mingwm10.dll --install-dir dist exam1.py 这三个dll都是PyQt运行时需用到的,最后一行指定打包输出目录。 打包完成后得到dist目录,其包含如下文件: exam1.exe mingwm10.dll PyQt.QtCore.pyd PyQt4.QtGui.pyd python25.dll QtCore4.dll QtCore4.dll sip.pyd
相关文章
- ios APP开发费用标准是多少
- mht2html mht 转换html工具
- dedecms 编辑器 附件按钮的修复
- python 3.2 mysql模块'int' does not support the buffer interface问题的解决
- 关于“LSM-Tree”
- 高效标准的图片预加载,预读取
- xbox live 用户好友下载器 xbox friendcenter
- cx_Freeze setup file not modle _elementpath error
- POST data should be bytes or an iterable of bytes. It cannot be str.
- 将多个文件打包成一个exe文件
- 版权声明:自由转载-非商用-非衍生-保持署名 | Creative Commons BY-NC-ND 3.0
- 原文网址:https://www.tianmeng.org/Technology_270/使用cx_freeze打包pyqt4程序为exe/
- 最后修改时间:2011年06月23日 19:47:52
当前暂无评论 »