CX_Freeze: Python.exe 没有响应

CX_Freeze: Python.exe not responding

我正在尝试将我的文本编辑器转换成一个 exe 来出售,但是 Windows 说当我尝试在 cmd 中转换它时 python.exe 没有响应。

我的文件名是arshi.py.

下面是我的setup.py:

import sys
from cx_Freeze import setup, Executable

base = None
if (sys.platform == "win32"):
    base = "Win32GUI"

exe = Executable(
        script = "arshi.py",
        icon = "icon.PNG",
        targetName = "Arshi.exe",
        base = base
        )

setup(
    name = "Arshi Editor",
    version = "0.1",
    description = "A lightweight text editor for Python",
    author = "Henry Zhu",
    options = {'build_exe': {"packages": ["pygments"]}},
    executables = [exe]
)

cx_freeze 不接受 .png 文件,而只接受 .ico 文件。将 .png 文件转换为 .ico 文件对我来说效果很好。