Categories
How to display data from a text document in Tkinter?
Please tell me how to display data from a text editor in Tkinter.
Answer the question
In order to leave comments, you need to log in
via variable or via file
Example:
from tkinter import * root = Tk() text = open('file.txt', encoding='utf-8').readlines() text = ''.join(text) textline = Text(root) textline.insert(1.0, text) textline.pack() root.mainloop()
textline.insert(1.0, 'ТЕКСТ')
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question