__str__ returned non-string (type
django error in models.py
__str__ returned non-string (type
--------------------------------
def __str__(self):
return self.username
4.5
4
from PIL import ImageTk as itk
background = "background.png"
'''
Don't write it this way:
photo = tk.PhotoImage(Image.open(background))
'''
# Correct way
photo = itk.PhotoImage(file = background) # Use Pillow to import .jpeg etc.
Thank you!
4
0
Are there any code examples left?
New code examples in category Python