from tkinter import *
a = Tk()


def mfileopen():
            from tkinter import filedialog
            file1 =filedialog.askopenfile()
            label = Label(text=file1).pack()
            file2 = file1.name #get file name
            f = open(file2)
            label2 = Label(text = f.read(), font=('arial',10,'bold')).pack()
            

button = Button(text = "openfile",width=30,command=mfileopen).pack()

a.mainloop()

77b5561ff5e1344dea78ec2bbb8a33fa952a5a82
<mask token>

<mask token>


def mfileopen():
    from tkinter import filedialog
    file1 = filedialog.askopenfile()
    label = Label(text=file1).pack()
    file2 = file1.name
    f = open(file2)
    label2 = Label(text=f.read(), font=('arial', 10, 'bold')).pack()


<mask token>
a.mainloop()

<mask token>
a = Tk()


def mfileopen():
    from tkinter import filedialog
    file1 = filedialog.askopenfile()
    label = Label(text=file1).pack()
    file2 = file1.name
    f = open(file2)
    label2 = Label(text=f.read(), font=('arial', 10, 'bold')).pack()


button = Button(text='openfile', width=30, command=mfileopen).pack()
a.mainloop()

from tkinter import *
a = Tk()


def mfileopen():
    from tkinter import filedialog
    file1 = filedialog.askopenfile()
    label = Label(text=file1).pack()
    file2 = file1.name
    f = open(file2)
    label2 = Label(text=f.read(), font=('arial', 10, 'bold')).pack()


button = Button(text='openfile', width=30, command=mfileopen).pack()
a.mainloop()

from tkinter import *
a = Tk()


def mfileopen():
            from tkinter import filedialog
            file1 =filedialog.askopenfile()
            label = Label(text=file1).pack()
            file2 = file1.name #get file name
            f = open(file2)
            label2 = Label(text = f.read(), font=('arial',10,'bold')).pack()
            

button = Button(text = "openfile",width=30,command=mfileopen).pack()

a.mainloop()
