I'm trying to make function that sees if an item is in the cart list and places an image from a folder that I have the images stored in but when I run the code it says filenotfound error and when I looked it up in old threads people said that I have to write the actual path
imagenames=[]
path1="C:\\Users\\3a2b\\Desktop\\lib\\images"
imagelist=os.listdir(path1)
for name in os.listdir(path1):
imagenames.append(os.path.splitext(name)[0])
def show_cart():
cartwindow = Toplevel()
for item in cart:
for i in range(len(imagenames)):
if item.title == imagenames[i]:
print("its there")
img = ImageTk.PhotoImage(open(os.listdir(path1)[i]))
label = Label(cartwindow,image=img)
label.grid(row=0,column=2)
```