Where is your icon stored?
What you have at the moment assumes that the icon file is in the current working directory.
If your .ico file is in a different directory, you’ll need to provide the path to the icon file.
Either using an absolute path.
e.g.
Python:
root.iconbitmap('/path/to/picture.ico')
Where
/path/to/
is the fully qualified path to the file picture.ico.
Or by using a relative path.
e.g.
Python:
root.iconbitmap('./subdir/picture.ico')
Where
./subdir/
is a sub directory of the current working directory.
Or if the file is in a directory that is higher in the tree than the working directory, you would use a number of instances of
../
to traverse upwards through the tree.
E.g.
Python:
root.iconbitmap('../../somedir/picture.ico')
Means the icon file is two levels up from the current working directory and inside a sub-directory there called
somedir
.
So you need to make sure that the icon file is somewhere appropriate AND that you provide the correct path to it in your Python script.