Well I have this:
import tkinter
gui = tkinter.Tk()
gui.iconbitmap(default=\'/home/me/PycharmProjects/program/icon.ico\')
gui.mainloop()`
B
There are two ways,
1) use xbm file in ubuntu as ubuntu will not able to read ico files. but issue here is xbm can display only black and white images.
2) use tkinter.photoimage to display icon image like below,
img = PhotoImage(file='your-icon')
root.tk.call('wm', 'iconphoto', root._w, img)
issue here is photoimage can read only GIF and PGM/PPM images.
see details here - https://stackoverflow.com/a/11180300