how do i make icons for my exe file when compiling my python program thanks in advance
I was searching for this a while ago, and found this: http://www.mail-archive.com/[email protected]/msg05619.html
Quote from above link:
The setup.py File: PY_PROG =
'trek10.py' APP_NAME = 'Trek_Game'
cfg = {
'name':APP_NAME, 'version':'1.0', 'description':'', 'author':'', 'author_email':'', 'url':'', 'py2exe.target':'', 'py2exe.icon':'icon.ico', #64x64 'py2exe.binary':APP_NAME, #leave off the .exe, it will be added 'py2app.target':'', 'py2app.icon':'icon.icns', #128x128 'cx_freeze.cmd':'~/src/cx_Freeze-3.0.3/FreezePython', 'cx_freeze.target':'', 'cx_freeze.binary':APP_NAME, }
--snip--
I have no experience with py2exe but a quick google search found this, if embedding icons in exe files was what you asked for.
If you want to create .ico files, I'd really suggest you search for a icon designer or finished icons. Sure you can create a Win 3.x style icon fairly easy by creating a 16x16, 32x32, or 64x64 px image in paint, and rename it to .ico. But to create modern multi resolution icons for windows is a lot more complicated.
(I was about to ask what OS you was compiling for, when I realized "exe" sounds very windows, and sure enough...)
Linking the icons is answered in other answers. Creating the thing is as easy as using png2ico. It creates an ico file from 1 or more png's and handles multiple sizes etc, like:
png2ico myicon.ico logo16x16.png logo32x32.png
Will create myicon.ico with sizes 16x16 and 32x32. Sizes must be multiples of 8 squares, and no larger than 256x256.
py2exe is a little dated, and has been continued with pyinstaller (which itself is a little dated; the svn release is the most up to date) http://pyinstaller.python-hosting.com/
After running through the initial scripts for pyinstaller and generating the spec file from Makespec.py, edit the spec file and look for the EXE section. At the tail end of that just add in your ico definition; so
console=True)
would become
console=True, icon='mine.ico' )
That is, if the mine.ico file were in the same folder as the Makespec.py file. There's also a command line option for feeding the icon into it. I think it was
python Makespec.py -i 'mine.ico' /path/to/file.py