首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

py2exe简略使用

2012-12-20 
py2exe简单使用1、首先下载已安装的对应Python版本的py2exe2、将写好的程序拷入类似文件夹C:\Python26\Lib\s

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


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

热点排行