No way what is suggested here works - the error "bitmap xxx not defined" is ever present. And yes, I set the correct path to it.
What it did work is this:
imgicon = PhotoImage(file=os.path.join(sp,'myicon.gif'))
root.tk.call('wm', 'iconphoto', root._w, imgicon)
where sp
is the script path, and root
the Tk root window.
It's hard to understand how it does work (I shamelessly copied it from fedoraforums) but it works