简体   繁体   English

适用于Mac的cx_freeze的setup.py脚本

[英]setup.py script for cx_freeze for mac

The following is what I am using for compiling my python scripts and it works, it compiles it all as it should: 以下是我用于编译python脚本的工具,它可以正常工作,并且可以按需进行编译:

from cx_Freeze import setup, Executable
exe=Executable(
     script="BattleShips/battleships.py",
     base="Win32Gui",
     )
includefiles=["BattleShips/boo.wav","BattleShips/yay.wav","BattleShips/boom.wav","BattleShips/finish.wav","BattleShips/titleimage.gif"]
includes=[]
excludes=[]
packages=[]
setup(

     version = "1.0",
     description = "BattleShips game!",
     author = "Shivam Paw",
     name = "BattleShips",
     options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includefiles}},
     executables = [exe]
)

Now I need to compile it all the same with the same includes but so it works for mac. 现在,我需要使用相同的include对其进行相同的编译,但是它适用于mac。

Is it only possible to use bdist_dmg on mac? 在Mac上只能使用bdist_dmg吗?

If so is there anyway I can compile it so it would work for mac but from my windows 7 pc? 如果有的话,我可以对其进行编译,以便它可以在Mac上运行,但可以从Windows 7 PC上运行?

Thanks. 谢谢。

Reposting as an answer: 重新发布作为答案:

No, you can't freeze to a Mac application on a Windows computer - cx_Freeze supports different platforms, but on each platform, it can only produce the executable format for that platform. 不,您不能冻结到Windows计算机上的Mac应用程序-cx_Freeze支持不同的平台,但是在每个平台上,它只能生成该平台的可执行格式。

Docs: http://cx-freeze.readthedocs.org/en/latest/faq.html#freezing-for-other-platforms 文件: http : //cx-freeze.readthedocs.org/en/latest/faq.html#freezing-for-other-platforms

I don't know of any alternatives that will let you make a Mac app on Windows. 我不知道有什么替代方法可以让您在Windows上制作Mac应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM