Reading icon in a .exe with tkinter's iconbitmap Reading icon in a .exe with tkinter's iconbitmap tkinter tkinter

Reading icon in a .exe with tkinter's iconbitmap


You can try to generate the icon on the fly just before the main loop of your application as in the third answer of this question. (Still you need to figure out how to write your icon to the string, but maybe that's a good question too!)


Since the icon has to be a .ico file, you could try to convert your image into a .ico file, for example here is some code I had to use for a Tkinter program and you can use the second line to convert your image into a .ico file to then use it:

ico = Image.open('Image_dossier/Cover.png')photo = ImageTk.PhotoImage(ico)root.wm_iconphoto(False, photo)