我已经安装了cx_freeze,它的工作方式就像构建.exe一样,但是我想使用Windows 7为Mac OS X创建我的python程序的可执行文件。您能指导我如何使用cx_freeze或任何其他应用程序来执行它。
我使用以下代码来构建.exe
from cx_Freeze import setup, Executable
build_exe_options = {
"packages": [],
'includes': ['lxml.etree', 'lxml._elementpath', 'gzip'],
'excludes' : ['boto.compat.sys',
'boto.compat._sre',
'boto.compat._json',
'boto.compat._locale',
'boto.compat._struct',
'collections.abc',
'boto.compat.array'],
"include_files": []}
setup(
name = "xyz",
version = "0.1",
description = "",
author = "Dengar",
options = {"build_exe": build_exe_options},
executables = [Executable("xyz.py")]
)
安装VirtalBox。
然后按照此指南安装OS X虚拟机:http : //lifehacker.com/5938332/how-to-run-mac-os-x-on-any-windows-pc-using-virtualbox
然后,您将能够安装Python工具并构建您的项目。
您还可以找到一个拥有OS X和Python工具的朋友…
这是OS X的指南:https : //pythonschool.net/pyqt/distributing-your-application-on-mac-os-x/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句