Pyinstaller使用介绍

pyinstaller能将python程序打包成一个可执行文件exe,支持 Python 2.7 and Python 3.4+, 目前最新版本是PyInstaller 3.4

官网: http://www.pyinstaller.org/

安装

pip install pyinstaller

最简单使用方法
pyinstaller yourprogram.py


执行完后你会在当前目录下发现生成了dist文件夹, dist文件夹下有你程序命名的文件夹,下面有可执行文件exe,已经python.dll等文件,这是默认的文件夹打包方式,下面介绍具体使用方法

具体用法介绍
有两种打包方式: 单文件夹(one single fold) 及 单文件 (one single executable file)两种方式,默认是前种方式
使用后者打包方式,只需 pyinstaller --onefile yourprogram.py

单可执行文件打包方式是从PyInstaller bootloader启动执行的,具体可参考 The Bootstrap Process in Detail



 

猜你喜欢

转载自www.cnblogs.com/energy1010/p/10247486.html