How do I use cx_Freeze on mac?

前端 未结 1 839
悲哀的现实
悲哀的现实 2021-01-23 00:16

I used python 3.4 and cx_Freeze on my mac. I was trying to convert my python script into a stand alone application here is the code I got in my setup.py file:

ap         


        
相关标签:
1条回答
  • 2021-01-23 00:32

    If you don't need Tcl you can exclude it in the setup file:

    application_title = "Death Dodger 1.0" 
    main_python_file = "DeathDodger-1.0.py"
    
    import sys
    
    from cx_Freeze import setup, Executable
    
    base = None
    if sys.platform == "win32":
        base = "Win32GUI"
    
    includes = ["atexit","re"]
    
    setup(
        name = application_title,
        version = "1.0",
        description = "Sample cx_Freeze PyQt4 script",
        options = {
            "build_exe" : {
                "includes" : includes
                "excludes": ['tcl', 'ttk', 'tkinter', 'Tkinter'], 
            }
        },
        executables = [
            Executable(main_python_file, base = base)
        ]
    )
    

    I excluded also Tkinter since as far as I can understand you are making use of PyQt4 to draw the user interface.

    0 讨论(0)
提交回复
热议问题