tkinter python icons won't show up in window

3.3k views Asked by At

I am trying to add an icon to my windows in python, I have got a .ico file, 16x16 in size, but when I run this script, the windows icon just looks like this: link, it doesn't show my custom icon. The .ico file is in the same location as the python file.

Here is my code:

import sys
import os
import tkinter as tk
c = 650
window = tk.Tk()
back = tk.Frame(width=700, height=c)
back.pack()
window.title("Notifications")
window.iconbitmap("image.ico")
window.mainloop()

How do I get my icon to show up properly on the window?

1

There are 1 answers

0
Grandtour On

Use an image converter. You shouldn't rename the extension of the file to .ico. You can use an online converter too, there are many.