py转exe

安装py2exe
http://prdownloads.sourceforge.net/py2exe
下载所安装的Python对应的py2exe版本. 然后双击运行安装.

新建一个名为 mysetup.py 的文件,内容如下:

 

# mysetup.py
from distutils.core import setup
import py2exe


options= {"py2exe":
{
"compressed":1,
"bundle_files":1
}
}


setup(
options = options,
zipfile=None,
console=["test3.py"]
)

 

>mysetup.py py2exe

这样就在当前目录下生成以 build 和 dist 两个文件夹.   dirst 中有两个文件一个是  你的所要的exe 另外 一个是 w9xpopen.exe  .

posted @ 2015-05-22 23:17  hitz&x  阅读(335)  评论(0编辑  收藏  举报