py2app選項 — py2app 0.19文檔

分享于 

4分钟阅读

Python

  简体 双语

py2app选项

可以将选项指定给 py2app,以三种不同的方式影响生成过程:

在 命令行:

$ python setup.py py2app --argv-emulation

在你的setup.py中:

setup(app=['MyApplication.py'],options=dict(py2app=dict(argv_emulation=1,)),)

setup.cfgfile: 中

[py2app]argv-emulation=1

setup.py中使用命令行选项时,必须将连字符( - ) 替换为下划线( _ ) 。setup.cfg文件可能使用连字符或者下划线,但命令行选项必须始终使用连字符。

要枚举py2app支持的选项,请使用以下命令:

$ python setup.py py2app --help

'py2app'命令的选项:

--optimize (-O) optimization level: -O1 for"python -O", -O2 for
"python -OO", and -O0 to disable [default: -O0]
--includes (-i) comma-separated list of modules to include
--packages (-p) comma-separated list of packages to include
--iconfile Icon file to use
--excludes (-e) comma-separated list of modules to exclude
--dylib-excludes (-E) comma-separated list of frameworks or dylibs to
 exclude
--datamodels xcdatamodels to be compiled and copied into
 Resources
--resources (-r) comma-separated list of additional data files and
 folders to include (not for code!)
--frameworks (-f) comma-separated list of additional frameworks and
 dylibs to include
--plist (-P) Info.plist template file, dict, or plistlib.Plist
--extension Bundle extension [default:.app for app,. plugin for
 plugin]
--graph (-g) output module dependency graph
--xref (-x) output module cross-reference as html
--no-strip do not strip debug and local symbols from output
--no-chdir (-C) do not change to the data directory
 (Contents/Resources) [forced for plugins]
--semi-standalone (-s) depend on an existing installation of Python
--alias (-A) use an alias to current source file (for development
 only!)
--argv-emulation (-a) use argv emulation [disabled for plugins].
--argv-inject inject some commands into the argv
--use-pythonpath allow PYTHONPATH to effect the interpreter's
 environment
--use-faulthandler enable the faulthandler (with python 3.3 or later)
--verbose-interpreter Start python in verbose mode
--bdist-base (-b) base directory for build library (default is build)
--dist-dir (-d) directory to put final built distributions in
 (default is dist)
--site-packages include the system and user site-packages into
 sys.path
--strip (-S) strip debug and local symbols from output (on by
 default, for compatibility)
--prefer-ppc Force application to run translated on i386
 (LSPrefersPPC=True)
--debug-modulegraph drop to pdb console after the module finding phase
 is complete
--debug-skip-macholib skip macholib phase (app will not be standalone!)
--emulate-shell-environment emulate the shell environment in a Terminal window
--qt-plugins comma-separated list of Qt plugins to include in a
 application using PyQt4.
--matplotlib-backends comma-separated list of matplotlib backends to include
 in an application using that library. The default is
 to include all of matplotlib. Use '*' to include all
 backends, and '-' to only include backends that are
 explicitly imported.
--extra-scripts comma-separated list of additional scripts to include
 in an application or plugin.
--include-plugins comma-seperated list of additional plugins to include
 in an application
--arch=ARCH The architecture set to include (intel, fat, universal,.. .)
 NOTE: The ARCH should be a subset of the architectures supported
 by the python interpreter.

DOC  Py2app  
相关文章