Python Forum

Full Version: Pyinstaller question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Not a showstopping question, but very confusing.
I can make an executable like so : pyinstaller --onefile --clean --windowed MYprogram.py ==> ...dist\MYprogram.exe

Now I want to show a clickable icon for this program on the windows desktop.
I have manufactured an icon: MYicon.ico

The more I read on how to do this , the more confusing it gets Sad
It must be something like :
pyninstaller --onefile --clean --icon??????? --windowed MYprogram.py
By what magic does the icon suddenly appear on the desktop?

thanks,
Paul
Like this have MYicon.ico in same folder as MYprogram.py.
pyinstaller --onefile --clean --icon=MYicon.ico --windowed MYprogram.py
This will give icon to MYprogram.exe,it will not magically appear on Desktop.
Right click on MYprogram.exe then send to --> Desktop(make shortcut).
(Oct-09-2022, 01:38 PM)snippsat Wrote: [ -> ]This will give icon to MYprogram.exe,it will not magically appear on Desktop.
I got more than magic, it's a miracle Wink
thanks,
Paul
Also, if you have PIL installed on your environment, you cound use any .png image as an icon for you application. Pyinstaller will try to automatically convert it for you!