首页 / 知识

如何从Python程序制作EXE文件?

2023-04-14 12:41:00

如何从Python程序制作EXE文件?

How can I make an EXE file from a Python program?

本问题已经有最佳答案,请猛点这里访问。

我已经使用了几个模块来制作适用于Python的EXE,但是我不确定自己是否做对了。

我应该怎么做,为什么? 请根据个人经验回答,并在必要时提供参考。


自动PY到EXE-使用从Python中使用Eel和PyInstaller构建的简单图形界面,从.py到.exe转换器。

py2exe可能是您想要的,但是它仅适用于Windows。
PyInstaller可在Windows和Linux上运行。
Py2app在Mac上可以使用。


我发现此演示文稿非常有帮助。

我如何在Windows上分发Python应用程序-py2exe和InnoSetup

从站点:

There are many deployment options for
Python code. I'll share what has
worked well for me on Windows,
packaging command line tools and
services using py2exe and InnoSetup.
I'll demonstrate a simple build script
which creates windows binaries and an
InnoSetup installer in one step. In
addition, I'll go over common errors
which come up when using py2exe and
hints on troubleshooting them. This is
a short talk, so there will be a
follow-up Open Space session to share
experience and help each other solve
distribution problems.


也称为冻结二进制文件,但与真正的编译器的输出不同-它们通过虚拟机(PVM)运行字节代码。由于已与PVM一起编译该程序,因此其运行大小与已编译的程序相同。 Py2exe可以冻结使用tkinter,PMW,wxPython和PyGTK GUI库的独立程序;使用pygame游戏编程工具包的程序; win32com客户端程序;和更多。
Stackless Python系统是标准的CPython实现变体,不会在C语言调用堆栈上保存状态。这使Python更易于移植到小型堆栈体系结构,提供有效的多处理选项,并培育了新颖的编程结构(例如协程)。正在研究未来发展的其他研究系统:Pyrex正在开发Cython系统,Parrot项目,PyPy正在完全替换PVM,当然Python的创始人正在与Google合作使Python运行5 Unladen Swallow项目的速度比C快十倍。简而言之,在这些项目改进了独立文件的Python虚拟机(PVM)之前,py2exe是最简单的,而Cython到目前为止效率更高。


使用cx_Freeze使exe成为您的python程序


gui2exe不在freehackers列表中,它可用于从Python脚本开始构建独立的Windows可执行文件,Linux应用程序和Mac OS应用程序包以及插件。


py2exe:

py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.


请参阅FreeHackers.org上的python打包工具的简短列表。


文件模块参考几个

最新内容

相关内容

猜你喜欢