py2exe简单使用
1、首先下载已安装的对应Python版本的py2exe
2、将写好的程序拷入类似文件夹
C:\Python26\Lib\site-packages\py2exe\samples
3、假设写好的程序全部放在capturer文件夹中
4、编写setup.py
如下:
from distutils.core import setupimport py2exesetup( # The first three parameters are not required, if at least a # 'version' is given, then a versioninfo resource is built from # them and added to the executables. version = "0.5.0", description = "py2exe sample script", name = "py2exe samples", # targets to build windows = ["main.py"]#main.py为项目主程序文件 )