Python Forum
Pyinstaller question - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Bar (https://python-forum.io/forum-27.html)
+--- Thread: Pyinstaller question (/thread-38405.html)



Pyinstaller question - DPaul - Oct-09-2022

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


RE: Pyinstaller question - snippsat - Oct-09-2022

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).


RE: Pyinstaller question - DPaul - Oct-10-2022

(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


RE: Pyinstaller question - carecavoador - Nov-01-2022

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!