Search code examples
pythoncx-freeze

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:

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.

Is it only possible to use bdist_dmg on mac?

If so is there anyway I can compile it so it would work for mac but from my windows 7 pc?

Thanks.


Solution

  • 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.

    Docs: 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.