How do I use cx_freeze?

后端 未结 5 941
心在旅途
心在旅途 2020-12-07 16:43

I\'ve created my setup.py file as instructed but I don\'t actually.. understand what to do next. Typing \"python setup.py build\" into the command line just gets a syntax er

5条回答
  •  无人及你
    2020-12-07 17:34

    • Add import sys as the new topline
    • You misspelled "executables" on the last line.
    • Remove script = on last line.

    The code should now look like:

    import sys
    from cx_Freeze import setup, Executable
    
    setup(
        name = "On Dijkstra's Algorithm",
        version = "3.1",
        description = "A Dijkstra's Algorithm help tool.",
        executables = [Executable("Main.py", base = "Win32GUI")])
    

    Use the command prompt (cmd) to run python setup.py build. (Run this command from the folder containing setup.py.) Notice the build parameter we added at the end of the script call.

提交回复
热议问题