创建单个 python 可执行模块

发布于 2024-08-16 21:55:40 字数 134 浏览 3 评论 0原文

伙计们,我在模块中有很多 python 代码,这些代码驻留在多个 python 包中,现在我需要创建单个 python 可执行模块或文件,其中将包含所有这些文件,因此它将在 Windows 和 Linux 服务器上运行。有哪些可能的解决方案以及如何实现?

Guys, I have much python code in modules which are resides in several python packages and now I need to create single python executable module or file which will include all these files, so it will be working on windows and on linux servers. What are possible solutions and how this can be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

泪之魂 2024-08-23 21:55:40

对于 Windows 使用 py2exe ,对于 Linux 使用 pyinstaller 对于 Mac 使用 py2app< /a>

使用这些工具,您可以拥有一个基于操作系统的 setup.py,它将构建最终的二进制文件。

我已经尝试了所有三个,它们运行良好,或者您可以使用 cx_freeze 他们声称是跨平台的

For windows use py2exe , for linux use pyinstaller and for Mac use py2app

Using these tools you can have a setup.py which based on os will build the final binary.

I have tried all three and they work well, or you can use cx_freeze they claim to be cross-platform

世界和平 2024-08-23 21:55:40

也许 py2exe 可以帮助你..

py2exe 是一个 Python Distutils 扩展,它将 Python 脚本转换为可执行的 Windows 程序,无需安装 Python 即可运行。

教程> http://www.py2exe.org/index.cgi/Tutorial

Maybe py2exe can help you ..

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

Tutorial > http://www.py2exe.org/index.cgi/Tutorial

樱娆 2024-08-23 21:55:40

您可以kivy进行Python跨平台应用程序。

Kivy - 用于快速开发应用程序的开源 Python 库
利用创新的用户界面,例如多点触控应用程序

You can kivy for python cross plat form application .

Kivy - Open source Python library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文