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.
Asked
Active
Viewed 5,374 times
5
-
possible duplicate of [How to set up icon for a program?](http://stackoverflow.com/questions/4915202/how-to-set-up-icon-for-a-program) – Tasos Sep 29 '13 at 09:56
-
1@Tasos I used cx_freeze and that person used py2exe – Infamouslyuseless Sep 29 '13 at 16:20
-
If there wasn't any edit option, I could swear it wasn't there before! Maybe I need a coffee before stackoverflow. Sorry for that. – Tasos Sep 29 '13 at 19:58
-
@Tasos I found out how to, never mind, it's in the setup.py file :) – Infamouslyuseless Sep 29 '13 at 20:21
-
@Infamouslyuseless : please do post what you found out - it helps other people who might read this when they have the same problem. – Thomas K Oct 01 '13 at 00:03
-
@ThomasK ok Sorry... shall i delete the comment then? – Infamouslyuseless Oct 01 '13 at 14:58
-
@Infamouslyuseless : the comments fine - I meant to say: write it up as a proper answer showing what you had to add to setup.py (and maybe explain why Blender's answer didn't work for you). – Thomas K Oct 01 '13 at 21:40
-
ok, i'll do it when i get back from school – Infamouslyuseless Oct 02 '13 at 06:25
2 Answers
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
)