创建单个 python 可执行模块
伙计们,我在模块中有很多 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于 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
这就是 Egg 文件的用途。阅读以下内容:什么将 python 库/应用程序打包为 .egg 文件有什么优点?
That's what egg files are for. Read this: What are the advantages of packaging your python library/application as an .egg file?
也许 py2exe 可以帮助你..
教程> http://www.py2exe.org/index.cgi/Tutorial
Maybe py2exe can help you ..
Tutorial > http://www.py2exe.org/index.cgi/Tutorial
您可以kivy进行Python跨平台应用程序。
You can kivy for python cross plat form application .