python程序之pyinsataller打包python程序

1、安装pyinstaller
下载安装pyinstaller地址: https://pypi.python.org/pypi/PyInstaller
如果已经安装了pip,直接输入“pip install pyinstaller”就搞定了。

2、使用pyinstaller 打包python程序
Pyinstaller命令的基本形式为:
pyinstaller [options] script [script ...] | specfile

用法:打开cmd,输入将被打包的程序目录,输入pyinstaller [options] script [script ...] | specfile即可
例:打包222.py文件,打开cmd,(默认为C盘)切换到在文件222.py 的目录下:输入G: 回车,然后输入cd python learn\project, 输入pyinstaller -F 222.py 即可打包成222.exe文件,并存放在相应文件夹中

cmd命令小技巧:
输入:cd 子目录,即可转入到子目录
输入:cd.. 即可返回上一目录
输入:dir 即可查询下一目录的所有文件名称
更多cmd命令: http://baike.sogou.com/v105714.htm?fromTitle=CMD命令

猜你喜欢

转载自blog.csdn.net/haoha210/article/details/79812084