2014-07-09 39 views
-1

我有一個像gorsel.py python腳本。我想通過setup.py將它轉換爲exe文件,但我得到圖標錯誤。cxfreeze圖標錯誤python34

我的設置代碼:


import sys 
from cx_Freeze import setup, Executable 

build_exe_options = {"packages": ["os"], "excludes": ["Tkinter"]} 
. base = None 
    if sys.platform == "win32": 
     base = "Win32GUI" 
    setup( name = "sifreleme", 
      version = "0.1", 
      description = "My GUI application!", 
      options = {"build_exe": build_exe_options}, 
      executables = [Executable("gorsel.py", base=base)]) 
    try: 
     import tkinter except ImportError: 
     import Tkinter as tkinter` 

我怎樣才能解決我的setup.py腳本?謝謝

回答

1

將此加入build_exe_options:"icon": "path/to/icon.ico"

+0

非常感謝。我添加''圖標「:」mypath/to/icon.ico「,但我得到了另一個錯誤:'python.exe被windows – user3818434