Goal: make "tomato.png"(the image on the left) the background of the window on the right.
The window wouldn't even come up when I'd run the code & I'd get this message:
_tkinter.TclError: couldn't recognize data in image file "tomato.png"
In previous work with tkinter I used tkk. to make words show up on a button I was using, I tried it here to no avail(This method was me hip-firing. I've only been studying Python since Dec, 31- there's a lot I do not know.)
I googled my issue and have a cursory knowledge of Pil/Pillow...so I installed Pillow through Pycharm.
There was some progress made. After installing Pillow through Pycharm the window actually came up, the error message did not, but...the image did not produce.
Also, this is the path to the python I am using: /Users/my_name/.pyenv/versions/3.10.0/bin/python
I would appreciate all the help you can give and keep in mind...I'm just two weeks into python with a background in finance- I am not pally with programming parlance...at all. Even when researching this issue there were suggestions to install pip through the command line and to be frank, I had no idea what was going on.
Also, this is my first post so don't crucify me if I didn't follow SOP in this post. Some of you guys are ruthless when answering questions.
I appreciate your time.
https://i.stack.imgur.com/BCehz.png the link to the photo of my code should be here^^
But I manually entered it here:
from tkinter import
from tkinter import ttk
from PIL import Image
from PIL import ImageTk
# ---------------------------- CONSTANTS ------------------------------- #
PINK = "#e2979c"
RED = "#e7305b"
GREEN = "#9bdeac"
YELLOW = "#f7f5dd"
FONT_NAME = "Courier"
WORK_MIN = 25
SHORT_BREAK_MIN = 5
LONG_BREAK_MIN = 20
# ---------------------------- TIMER RESET ------------------------------- #
# ---------------------------- TIMER MECHANISM ------------------------------- #
# ---------------------------- COUNTDOWN MECHANISM ------------------------------- #
# ---------------------------- UI SETUP ------------------------------- #
window = Tk()
window.title("Pomodoro")
canvas = Canvas(width=200, height=224)
tomato_pic = Image.PhotoImage(file="tomato.png")
canvas.create_image(100, 112, image=tomato_pic)
canvas.pack()
window.mainloop()