关于py2exe的setup.py的部分释疑
来源:互联网 发布:电信网络维修 编辑:程序博客网 时间:2024/06/06 05:20
What you need to understand about Distutils:
The Distutils module is part of the standard python distribution. Distutils is used by python module developers to package and distribute new modules. The setup syntax py2exe uses is inherited from distutils. (If you choose the default Windows installation for python, distutils can be found at: C:/Program Files/Python##/Lib/distutils/). The setup function of Distutil recognizes specific keywords, which are also available when running py2exe. The following is a list of some more useful distutils keywords
keyword
description
data_files
list of "data" files that you are going to need to run your executable such as .pngs, .jpgs
Py2exe extends Distutils setup keywords
In addition to the standard distutils setup keywords, the following py2exe keywords specify what and how to build.
keyword
description
console
list of scripts to convert into console exes
windows
list of scripts to convert into GUI exes
service
list of module names containing win32 service classes
com_server
list of module names containing com server classes
ctypes_com_server
list of module names containing com server classes
zipfile
name of shared zipfile to generate; may specify a subdirectory; defaults to 'library.zip'. Ifzipfile is set to None, the files will be bundled within the executable instead of 'library.zip'.
options
dictionary { "py2exe": { "opt1": val1, "opt2": val2, ... } }
The options dictionary of py2exe
The option keyword takes the following set of dictionary key: value pairs. The dictionary "key" names and the "value" types are listed in the table below.
key
value
unbuffered
if true, use unbuffered binary stdout and stderr
optimize
string or int of optimization level (0, 1, or 2) 0 = don’t optimize (generate .pyc) 1 = normal optimization (like python -O) 2 = extra optimization (like python -OO) See http://docs.python.org/distutils/apiref.html#module-distutils.util for more info.
includes
list of module names to include
packages
list of packages to include with subpackages
ignores
list of modules to ignore if they are not found
excludes
list of module names to exclude
dll_excludes
list of dlls to exclude
dist_dir
directory in which to build the final files
typelibs
list of gen_py generated typelibs to include
compressed
(boolean) create a compressed zipfile
xref
(boolean) create and show a module cross reference
bundle_files
bundle dlls in the zipfile or the exe. Valid values for bundle_files are: 3 = don't bundle (default) 2 = bundle everything but the Python interpreter 1 = bundle everything, including the Python interpreter
skip_archive
(boolean) do not place Python bytecode files in an archive, put them directly in the file system
ascii
(boolean) do not automatically include encodings and codecs
custom-boot-script
Python file that will be run when setting up the runtime environment
Example:
setup( windows=['trypyglet.py'], options={ "py2exe":{ "unbuffered": True, "optimize": 2, "excludes": ["email"] } })
For more information enter the following at the python command line:
>>> from distutils.core import setup>>> help(setup)
引自:http://www.py2exe.org/index.cgi/ListOfOptions
- 关于py2exe的setup.py的部分释疑
- 好用的py2exe的setup.py脚本
- py2exe 2.7 将引用matplotlib库的程序转成exe的setup.py 的编写
- 【python】关于py2exe编译py时用到的配置文件
- 关于Python的setup.py文件
- py2exe-为你的py文件打包
- py2exe-为你的py文件打包
- py2exe-为你的py文件打包
- py2exe-为你的py文件打包
- python的setup.py文件
- python的setup.py文件
- 关于python中将py文件转换成exe文件的问题(使用py2exe)
- 关于引用的一个释疑
- 指针部分释疑之一:指针的实质
- 删除 setup.py 安装的 Python 软件包
- python的setup.py文件及其常用命令
- python的setup.py文件及其常用命令
- 删除 setup.py 安装的 Python 软件包
- D1、D系列分辨率是多少
- C#中的变量、字段、域、属性、属性过程
- 正确配置nfs服务器
- Android 删除手机联系人,添加手机联系人,更新手机联系人信
- 应聘时漂亮的回答,一生受益的语言
- 关于py2exe的setup.py的部分释疑
- 简单的批处理切换目录
- jsp四种对象的作用范围
- 学习笔记之---C#中的委托与事件
- 设计模式笔记4:简单工厂模式(Simple Factory Pattern)
- POJ 1926 Pollution 直接模拟也能过!!
- Asp.net中后台*.cs与前台JS脚本之间相互调用的几点心得
- MappedByteBuffer的使用
- 内核char设备号的注册与注销