I want to know whether I can display an image from the path I have selected? like, I have a path for example: c:\\user\\desktop\\33.jpg, and I want to take only that jpg fil
Here is a sample code for what you are asking:
from Tkinter import Label,Tk
from PIL import Image, ImageTk
import tkFileDialog
root = Tk()
path=tkFileDialog.askopenfilename(filetypes=[("Image File",'.jpg')])
im = Image.open(path)
tkimage = ImageTk.PhotoImage(im)
myvar=Label(root,image = tkimage)
myvar.image = tkimage
myvar.pack()
root.mainloop()
You will be wanting to add a button for calling the askopenfilename
because right now its calling it the moment the program begins.
Also you might wanna add more file extensions to filetypes