Create a desktop icon for a Tkinter script Create a desktop icon for a Tkinter script tkinter tkinter

Create a desktop icon for a Tkinter script


I create executables(icons that I click to start the programs I write) using 'py2exe'. I use windows 7 and I am not sure if it would work for you with Raspberry Pi, but a google search may clear that up for you. I will provide the link below. Basically you end up with a folder with the executable(icon) and also some files, without which the executable won't work. It's unfortunate that you get this extra 'baggage', but it's still handy and the best solution I have come across. I don't think there is a much better way, but I am not 100% on that. Interestingly, I found that you could delete most of these baggage files and the executable would still work, it was trial and error, but it didn't take long. If I want to send the folder to someone, I zip it first.

py2exe is here

If you need a 64 bit binary you can get it here, along with, actually, pretty much every other version. get py2exe here also


Besides creating executable file other option is create simple .bat file:

  1. Open notepad
  2. Enter "C:\ProgramData\Anaconda3\python.exe" "C:\Users\Your ID\script.py"First part is path to python.exe, second to your python script
  3. save file as .bat file, ex. "open_program.bat"

Now simply double click on saved .bat file icon should open your script.


I like using cx-freeze to convert python scripts to exe.

There is very easy to follow documentation to do this. In short, you create a setup.py script that specifies what libraries and packages you want to include or exclude in your application.

You can then run the build in the console and it will create a build folder, in which will be an Application File. You can create a Desktop short cut using send to and selecting desktop.

Documentation link