py2exe简单使用

1、首先下载已安装的对应Python版本的py2exe
2、将写好的程序拷入类似文件夹
C:\Python26\Lib\site-packages\py2exe\samples
3、假设写好的程序全部放在capturer文件夹中
4、编写setup.py
如下:
from distutils.core import setup
import py2exe

setup(
    # 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为项目主程序文件
    )

5、在doc命令行中进入
C:\Python26\Lib\site-packages\py2exe\samples\capturer
6、运行
Python setup.py py2exe

你可能感兴趣的:(C++,c,windows,python,C#)