Python Forum
Pyinstaller question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pyinstaller question
#1
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
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#2
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).
Reply
#3
(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
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#4
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!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020