#function to open the file
import tkinter as tk
from tkinter.scrolledtext import ScrolledText
from tkinter import filedialog
root = tk.Tk()
textPad = ScrolledText(root)
def open_command():
file = filedialog.askopenfile(parent=root,mode='rt',title='Select a file')
if file != None:
contents = file.read()
textPad.insert('1.0',contents)
file.close()
Я хочу знать, как мне вставить содержимое, которое я прочитал, в мой GUI, чего не происходит.