Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

Is there any way to load an image into a python 3.4 tkinter window? I've spent more time online to get an answer for my question, without using PIL, which I can't get it, I just want know is there any way to achieve this?

python image python-3.x tkinter 

1 Answer

0 votes
by (26.4k points)

tkinter can be used for displaying GIF images since it has PhotoImage class

You can use the following code:

import Tkinter as tk

root = tk.Tk()

image = tk.PhotoImage(file="myfile.gif")

label = tk.Label(image=image)

label.pack()

root.mainloop() 

Want to learn more about python, Come & join: Python training course

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...