打包python为应用程序

python第三方库安装工具pip的安装:

pip:  A tool for installing and managing Python packages.

要用到第三方包,python的版本就必须是2.7

https://pypi.python.org/pypi/setuptools#downloads

python ez_setup.py

https://pip.pypa.io/en/latest/installing.html#python-os-support

python get-pip.py

使用pyinstaller打包应用:

使用pip安装pyinstaller:

pip install pyinstaller

使用

pyinstaller -windows sharesRead.py

pyinstaller用法帮助

pyinstaller -h

使用py2app打包(只支持mac os系统,windows使用py2exe):

安装py2app: sudo pip install py2app 
打包: 
1、进入工程目录下面: 
cd ProjectDirctory 
2、生成 setup.py 文件: 
py2applet --make-setup MyApplication.py 
3、清空以前生成的编译文件: 
rm -rf build dist 
4、生成mac下的应用:
python setup.py py2app 
5、生成的应用在dist目录下面

还有一种方法是建一个C++的工程,使用Python的C++接口,来打包一个C++的应用程序。这涉及到C++与Python的相互调用:
使用C/C++扩展Python

Python与C/C++ 模块相互调用

    原文作者:woodcol
    原文地址: https://blog.csdn.net/fengmm521/article/details/78438770
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞