i need away to be able to show an image when i run the python code in its gui form if possible. Also do i have to type in the folder name and file name in the code if you know the answer i tried pil all it did was save the image into a folder i want this on the gui
the code for the tk if it is necessary
from Tkinter import *
root = Tk()
toolbar = Frame(root)
# All the buttons in my program
b = Button(toolbar, text="Home", width=9)
b.pack(side=LEFT, padx=2, pady=2)
b = Button(toolbar, text="About-us", width=9)
b.pack(side=LEFT, padx=2, pady=2)
b = Button(toolbar, text="Contact-us", width=9)
b.pack(side=LEFT, padx=2, pady=2)
b = Button(toolbar, text="Travelling", width=9)
b.pack(side=LEFT, padx=2, pady=2)
toolbar.pack(side=TOP, fill=X)
# All the labels in my program
o = Label(root,text="Frank Anne",font =("Italic",18,"bold"))
o.pack()
toolbar1 = Frame(root)
o=Label(root,)
o.pack()
o=Label(root,text ="Age: 27")
o.pack()
o=Label(root,text ="Address: 71 strawberry lane, JU8 8TY")
o.pack()
toolbar1.pack(side=BOTTOM, fill=X)
mainloop()
Hello if your looking to show an image inside a tk Canvas it needs to be a PPM/PGM or GIF: discussion from python.org
However if your looking to load a PPM, PGM or GIF:
This creates a frame, loads the image using tk.PhotoImage, then makes a canvas and puts the image onto the canvas.
If I understand, you just want to show an image using Tkinter?
To do this, you can use a Canvas widget filled with your image.
Here is an example: