Не могу понять как вывести файл во фрейм. Скрин программы вкладываю.
from tkinter import*
from tkinter import ttk
from tkinter.filedialog import*
import sys
def Quit(ev):
global root
root.destroy()
def OpenFile(ev):
name = askopenfilename(filetypes =(("Текст", "*.txt"),("All Files","*.*")),title = "Открытие файла...")
print(name)
try:
with open(name,'r') as UseFile:
textFrame=print(UseFile.read())
except:
print("No file exists")
root=Tk()
textFrame = Frame(root,height = 10, width = 60)
textFrame.pack(side = 'top', expand = False)
textbox = Text(textFrame, font='Arial 14', wrap='word')
textbox.pack(side = 'left',expand = False)
label = ttk.Label(root,width=650,text =" Откройте файл, который хотите просмотреть",foreground="black",background="light blue",font=("Helvetica", 16))
label.pack()
panelFrame=Frame(root,height=100,bg='gray')
panelFrame.pack(side='top',fill='x',expand=True)
root["bg"] = "grey"
root.state("zoomed")
label = ttk.Label(root,width=600,text ="",foreground="black",background="light blue",font=("Helvetica", 16))
label.pack()
Title = root.title( "Просмотрщик документов")
loadBtn=Button(panelFrame,text='Завантаження')
quitBtn=Button(panelFrame,text='Вихід')
loadBtn.bind("<Button-1>",OpenFile)
quitBtn.bind("<Button-1>",Quit)
loadBtn.place(x=10,y=10,width=90,height=90)
quitBtn.place(x=1270,y=10,width=90,height=90)
root.mainloop()