Change the icon of tkinter python window

 CHANGE THE ICON OF TKINTER PYTHON 

WINDOW

By Default windows icon looks like this below picture:

By Default icon


Change the Tkinter window icon for use only this below function.
window.iconbitmap()

now we will see how to write code for change the tkinter
icon.
firstly you can see my icon file location where are stored 
my icon file.
Icon Path

my icon file name is vi.ico as you can see in the above image
now we will see full code of change icon of window.

CODE:

from tkinter import *
window = Tk()
window.title("Window icon")
window.geometry("350x200")
iconPath="D:/icon/vi.ico"
window.iconbitmap(iconPath)
window.mainloop()

OUTPUT


window icon

Comments