from tkinter import *
root = Tk()
root.geometry('100x100')
# Create a Button
btn = Button(root, text = 'Click me !', bd = '5',
command = root.destroy)
# Set the position of button on the top of window.
btn.pack(side = 'top')
root.mainloop()
import tkinter as tk
from tkinter import filedialog
def UploadAction(event=None):
filename = filedialog.askopenfilename()
print('Selected:', filename)
root = tk.Tk()
button = tk.Button(root, text='Open', command=UploadAction)
button.pack()
root.mainloop()