1

I've been starting to learn python recently and have spent several hours trying to find a way to set a custom icon for the application however all the results that I find are either outdated or incompatible with Mac. Is there a working example for all platforms that I can use? A custom GUI is not on the top of priorities but if there is a documentation that I haven't found I would be very grateful if someone could show me.

Edit:

Just a quick summary of Jonah very kindly provided:

  1. Download get-pip.py here
  2. Run get-pip.py from terminal using: "python get-pip.py"
  3. Install py2app with: "pip install -U py2app"

           Note!

           This may not apply to everyone but I have to use: "pip3 install -U py2app"

  4. Use and download configuration similar to this

  5. Convert your file to a .icns at this site
  6. Set the filepaths in the setup.py according to your .py script and your icns image.
  7. Run the setup.py with: "python setup.py py2app"
  8. Locate your app in the dist folder that was created :)
Community
  • 1
  • 1
Pigman168
  • 399
  • 1
  • 4
  • 13

1 Answers1

1

Ok. So to add an icon from memory you have to make a .icns file. Follow these or these instructions. Secondly you have to make the program into an app. To do this follow the instructions here but don't do it yet. Ok now go into setup.py and add under options 'iconfile' : 'icon.icns'. Create the app now. It will only work if you put the icns image in the same folder as setup.py. This will add both a icon to the app and the top corner where the Tkinter logo shows on Windows.

Jonah Fleming
  • 1,187
  • 4
  • 19
  • 31
  • @Pig Also go [here](http://pythonqanda.weebly.com) to contact me via email. I can then give further help! – Jonah Fleming Oct 07 '15 at 05:46
  • Sorry D: having issues installing py2app and I don't know how to accept the answer. – Pigman168 Oct 12 '15 at 17:44
  • @pig What is the problem? – Jonah Fleming Oct 12 '15 at 20:24
  • @pigman To install pip read the instructions [here](http://pip.readthedocs.org/en/stable/installing/). Then go pip install py2app. After that py2app is installed and you just need to create your setup.py file according to [this](https://pythonhosted.org/py2app/) documentation, and then run py2app setup.py. – Jonah Fleming Oct 12 '15 at 21:24
  • Update! Thank you very very much for your help! Everything works now :) – Pigman168 Oct 13 '15 at 06:19