-1

I'm traying to make an app GUI using tkinter. how do I change the window icon? I trayed to do:

import tkinter as tk
root = tk.Tk()
root.iconbitmap('app_icon.ico')
root.mainloop
HeaG
  • 41
  • 6

2 Answers2

1

I think you have to show that path to the ico picture, try this:

import tkinter as tk
root = tk.Tk()

root.iconbitmap('/path/to/ico/app_icon.ico')
root.mainloop()
Hunter
  • 321
  • 2
  • 11
0

Below code worked for me, you can check this for your scenario

from tkinter import *

root=Tk()

p1 = PhotoImage(file = "/path/to/ico/app_icon.ico") 
  
root.iconphoto(False, p1)

root.mainloop()
John_ny
  • 767
  • 12
  • 33