py2exe 0920已经支持了
Build standalone executables for Windows (python 3 version)
py2exe is a distutils extension which allows to build standalone
Windows executable programs (32-bit and 64-bit) from Python scripts;
Python 33 and later are supported It can build console executables,
windows (GUI) executables, windows services, and DLL/EXE COM servers
>
如果是想要打包发布程序,使得程序可以在其他电脑上运行还需要拷贝动态运行库的。
需要将待发布的release版的exe文件和dll文件放到一个文件夹下
具题需要以下的dll文件:
可以去你的Qt安装目录下复制,我这里是:D:QtQt51111mingw48_32in
platforms文件夹下面包含:qminimaldll和qwindowsdll
所在的文件夹是:D:QtQt51111mingw48_32pluginsplatforms
import sys
from math import
from PyQt5QtCore import
from PyQt5QtWidgets import QApplication, QDialog, QLineEdit, QTextBrowser, QVBoxLayout
class Form(QDialog):
def __init__(self, parent=None):
super(Form, self)__init__(parent)
selfbrowser = QTextBrowser()
selflineedit = QLineEdit("Type an expression and press Enter")
selflineeditselectAll()
layout = QVBoxLayout()
layoutaddWidget(selfbrowser)
layoutaddWidget(selflineedit)
selfsetLayout(layout)
selflineeditsetFocus()
selflineeditreturnPressedconnect(selfupdateUi)
selfsetWindowTitle("Calculate")
def updateUi(self):
try:
text = selflineedittext()
selfbrowserappend("%s = <b>%s</b>" % (text, eval(text)))
except:
selfbrowserappend("<font color=red>%s is invalid!</font>" % text)
selflineeditsetText('')
if __name__=="__main__":
app = QApplication(sysargv)
form = Form()
formshow()
appexec_()
运行这个程序就能得到一个小的计算器,前提你已经安装好了pyqt
python中的GUI可以利用pyqt进行编写
以上就是关于python3.3、Eric5与pyqt编写的GUI程序如何编译成可执行文件全部的内容,包括:python3.3、Eric5与pyqt编写的GUI程序如何编译成可执行文件、pyQt5程序如何作成release模式_pyqt5使用、如何用 Python 写一个带 GUI 的科学计算程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)