发布python的exe可执行文件(使用PyInstaller库)

1、下载最新版本的PyInstaller。 地址:https://pypi.python.org/pypi/PyInstaller/3.1.1

解压缩到C:\Python34目录下。

2、下载最新版本的pywin32。地址:https://sourceforge.net/projects/pywin32/files/pywin32/,点击安装程序默认位置安装。

3、进入cmd。执行:

     d:\>cd C:\Python34\PyInstaller-3.1.1

     python pyinstaller.py     

4、

     Usage: python pyinstaller.py [opts] <scriptname> [ <scriptname> ...] | <specfile>   
     pyinstaller.py: error: Requires at least one scriptname file or exactly one .spec-file

     显示以上信息表示可以开展工作了,             

5、 把xuexi.py文件放入 C:\Python34\PyInstaller-3.1.1  里。

6、 执行:  python pyinstaller.py --console --onefile  xuexi.py      

7、会生成一个xuexi文件夹。在这个文件夹下面会有一个名为dist的文件夹,此文件夹下面有转换好的xuexi.exe                

posted on 2016-04-27 00:09  cxkof  阅读(251)  评论(0)    收藏  举报

导航