【发布时间】:2017-01-03 13:25:16
【问题描述】:
我正在尝试将名为“applicationtest.py”的脚本转换为独立的 osx 应用程序。我曾尝试使用 py2app:https://pythonhosted.org/py2app/tutorial.html 和 cxfreeze:http://cx-freeze.readthedocs.io/en/latest/script.html#script 这样做。这两个模块都创建了一个文件夹,其中包含您的新应用程序 + 所需的支持包/脚本/lib。
但是,当我查看这些文件夹时,我注意到库是为 python 2.7 设置的,而我想变成应用程序的脚本是用 3.6 编写的。
例子:
:dist username$ tree
给予:
.
└── applicationtest.app
└── Contents
├── Info.plist
├── MacOS
│ ├── applicationtest
│ └── python -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python
├── PkgInfo
└── Resources
├── PythonApplet.icns -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/Resources/PythonApplet.icns
├── __boot__.py
├── __error__.sh
├── lib
│ └── python2.7
│ ├── config -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
│ └── site.pyc -> ../../site.pyc
├── site.py
└── site.pyc
7 directories, 10 files
问:创建应用时如何设置使用python 3?
提前致谢!
【问题讨论】:
标签: python macos cx-freeze py2app