|
|
|
from tkinter import *
root = Tk()
root.title("Tk Example")
root.minsize(200, 200) # width, height
root.geometry("300x300+50+50")
# Create Label in our window which is then used
# to display an image on that label.
image = PhotoImage(file="anime-wave.gif")
img = Label(root, image=image)
img.pack()
root.mainloop()
|
 |
|
The above code shows how easy it is to make a basic GUI and then use that to display an image, more functional
interfaces can be created but this is one of the easier examples in the use of Tkinter.
You can adjust the size of the window to display a larger image by adjusting the geometry (root.geometry) to
set a larger size for the image. The Label that is created in the above code will automatically take all of the
available space based in the geometry specification.
|
|
|