I have a tkinter python file saved in a folder on the directory. The icons and other resources are for the file are saved in another folder.
root_directory
|
|---resources
| |
| |---icon.png
|
|---windows
| |
| |---tkinter_file.py
In tkinter_file.py
, I want to set an icon for the tkinter window. So, I did something like:
root.iconphoto(False, tk.PhotoImage(file='../resources/icon.png'))
But, this shows up an error:
_tkinter.TclError: couldn't open "../resources/icon-appointment.png": no such file or directory
Please help me out to successfully locate the PNG file located in a different folder.