I have a program with Tkinter window and I want to set an icon for the window. I coded this:okno.iconbitmap(os.path.dirname(os.path.abspath(__file__))+\"/icon.png\")>
okno.iconbitmap(os.path.dirname(os.path.abspath(__file__))+\"/icon.png\")>
Code to turn files into ico format with pillow library. Available formats: https://pillow.readthedocs.io/en/latest/handbook/image-file-formats.html
from PIL import Image filen = r'icon.png' img = Image.open(filen) img.save('icon.ico',format = 'ICO', sizes=[(32,32)])