0

If I use the code below like

photo_label = Label(root, image=photos[0]).pack()

and print(type(photo_label)) it come up nonetype but if use it seperated like below then it's a tkinter label. why this happening?

photo_label = Label(root, image=photos[0])
photo_label.pack()
  • 3
    It is because `.pack()` returns `None`. – acw1668 Jun 08 '22 at 06:50
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 08 '22 at 07:39
  • 1
    Does this answer your question? [Tkinter: AttributeError: NoneType object has no attribute ](https://stackoverflow.com/questions/1101750/tkinter-attributeerror-nonetype-object-has-no-attribute-attribute-name) – Matiiss Jun 08 '22 at 08:44
  • @acw1668 thank you I never thought of that. Thank you very much – Muhammed Ali Baturhan Aktekin Jun 08 '22 at 11:08

0 Answers0