August 27th, 2003, 06:33 PM
custom icons through py2exe
Hi, I'm a relative beginner to programming -- not quite been codinga year, but I'm getting pretty good at python, and beginning to learn Java.
Anyway, I'm learning how to use py2exe (I'm on WIndows 2000, btw) and I would like to make a custom icon for my program "a.py"
C:\a.py is the directory for my program, C:\setup.py is my distutils setup file, and C:\icon.ico is my icon file.
My setup file is this:
from distutils.core import setup
description="Writes newlines correctly from downloaded text files",
icon_file = "icon.ico",
the icon_file variable I found from a pygame tutorial on this...don't have the URL on me anymore, but it may not even work without pygame (I wrote it in plain python). I have tried building the exe two ways: with the icon_file variable both ways and w/o it both ways. They all work, but none of them gives me the right icon!
That just makes C:\dist\a\a.exe and all those files, but w/o the icon
C:>setup.py py2exe --icon "C:\icon.ico"
ends up doing the same thing, though the py2exe documentation says that it should make the exe have that icon!
Please help me, I don't know what else to do. Again, I'm running on Windows 2k, and I really need the icon file so it looks better for distribution (as is part of my setup.py file, it's just a simple little file utility I want to start off a small online software company, I'm still in HS, so don't expect big things ; D)
Thank you in advance for any help you can give!
October 18th, 2004, 12:56 PM
Try this--it may help
example from my setup.py at the end of my setup() section
windows = [
not sure what the '1' means in the args, but it worked for me.
October 18th, 2004, 03:02 PM
hehe -- over a year passed but someone eventually responded ^_^.
Anyway, the "1" as args prolly just means True, use icons. Don't know for sure -- could also be a len(list) of the rest of the args.
Thanks for replying btw ^_^
October 18th, 2004, 03:22 PM
Just turned out that I ran into the same problem, and found your post via google.
Originally Posted by rowenlemmings
I found another reference somewhere else, and thought I would add this info here, since I found this post before the solution.
October 18th, 2004, 08:32 PM
it could also be the fact that some icon resources (such as various DLLs) contain more than one icon in them, and thus the "1" is simply specifying the first (in this case only) icon.