浏览 180 次
|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
时间:2008-05-06 关键字: py2exe
最近公司让把几个python srcript的打包成EXE,查了一些资料,完成打包,总结一下:
1.安装py2exe插件 2. 新建一个setup.py 文件,文件内包含以下的代码 #!/usr/bin/python # -*- coding: utf-8 -*- # py2exe file # 1.install py2exe application # 2.python setup.py py2exe from distutils.core import setup import py2exe includes = ["Action","CryptoUtil", "Phone" ,"PerformanceTest","SecureChannel"] options = {"py2exe": { "compressed": 1, "optimize": 2, "includes": includes, "bundle_files": 1 } } setup( version = "0.1.0", description = "Performance Test", name = "Performance Test", options = options, zipfile=None, console=["PerformanceTest.py"],data_files=["pt.ini"], ) 3. dos 下执行:python setup.py py2exe 4.执行成功后该文件夹会生成两个文件夹,查看dist文件夹即可看到exe文件 声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
| 返回顶楼 | |
|
时间:2008-05-07
强啊,打包出来的exe有多大,是否包含完整的Python运行时?
|
|
| 返回顶楼 | |
|
时间:2008-05-08
包含Python运行环境
|
|
| 返回顶楼 | |




