5

I've made a .exe file of a game I made in Python, but I'm not sure how to make that exe file have an icon, because it looks dull and boring. I want to somehow make the icon be a picture of an asteroid let's say, because I made the game asteroids. I used cx_freeze to compile it.

Infamouslyuseless
  • 922
  • 2
  • 8
  • 15

2 Answers2

4

Add it to the options in your setup.py file:

setup(
    ...
    options={
        "build_exe": {
            "icon": "path/to/icon.ico"
        }
    }
)
Blender
  • 289,723
  • 53
  • 439
  • 496
  • This isn't working for me and I don't see any reference to an icon parameter for build_exe options in the docs. https://cx-freeze.readthedocs.io/en/latest/distutils.html#build-exe – Max Strater Dec 21 '18 at 01:49
0

This is easier to understand!

import cx_Freeze
import sys
base = None

if sys.platform == 'win32':
   base = "Win32GUI"

executables = [cx_Freeze.Executable("example.pyw", base=base)]

cx_Freeze.setup(
name = "SeaofBTC-Client",
options = {"build_exe": {"packages":["tkinter",],"icon":"example.ico"}},
version = "0.01",
description = "Sea of BTC trading application",
executables = executables
)