open file tkinter code example
Example 1: askopenfilename
filename2 = filedialog.askopenfilename(title = "Select file",filetypes = (("Excel files", ".xlsx .xls"),))
Example 2: tkfiledialog python 3 example
from tkinter import *
root = Tk()
root.filename = filedialog.askopenfilename(initialdir = "E:/Images",title = "choose your file",filetypes = (("jpeg files","*.jpg"),("all files","*.*")))
print (root.filename)
root.withdraw()