Create single python executable module

半城伤御伤魂 提交于 2019-12-30 02:19:47

问题


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?


回答1:


That's what egg files are for. Read this: What are the advantages of packaging your python library/application as an .egg file?




回答2:


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




回答3:


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




回答4:


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



来源:https://stackoverflow.com/questions/1999129/create-single-python-executable-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!