Question : TypeError: __str__ returned non-string (type instance)
Answered by : outtaspace-z5i9uqqdl3es
from PIL import ImageTk as itk
background = "background.png"
'''
Dont write it this way:
photo = tk.PhotoImage(Image.open(background))
'''
# Correct way
photo = itk.PhotoImage(file = background) # Use Pillow to import .jpeg etc.
Source : https://stackoverflow.com/questions/27180497/typeerror-str-returned-non-string-type-instance | Last Update : Sun, 06 Jun 21