To get Tkinter input from the text box, you must add a few more attributes to the normal .get() function. If we have a text box myText_Box, then this is the method for retrieving its input.

def retrieve_input():
    input = self.myText_Box.get("1.0",END)

The first part, "1.0" means that the input should be read from line one, character zero (ie: the very first character). END is an imported constant which is set to the string "end". The END part means to read until the end of the text box is reached. The only issue with this is that it actually adds a newline to our input. So, in order to fix it we should change END to end-1c(Thanks Bryan Oakley) The -1c deletes 1 character, while -2c would mean delete two characters, and so on.

def retrieve_input():
    input = self.myText_Box.get("1.0",'end-1c')
Answer from xxmbabanexx on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-tkinter-text-widget
Python Tkinter - Text Widget - GeeksforGeeks
July 12, 2025 - We can insert media files such as images and links also in the Textwidget. Syntax: T = Text(root, bg, fg, bd, height, width, font, ..) ... import tkinter as tk root = Tk() # specify size of window.
🌐
Tutorialspoint
tutorialspoint.com › python › tk_text.htm
Tkinter Text
from tkinter import * root = Tk() text = Text(root) text.insert(INSERT, "Hello.....") text.insert(END, "Bye Bye.....") text.pack() text.tag_add("here", "1.0", "1.4") text.tag_add("start", "1.8", "1.13") text.tag_config("here", background="yellow", foreground="blue") text.tag_config("start", background="black", foreground="green") root.mainloop() When the above code is executed, it produces the following result − ·
Discussions

python - How to get the input from the Tkinter Text Widget? - Stack Overflow
Sign up to request clarification or add additional context in comments. ... You should do "end-1c" or END+"1c", otherwise you'll get the extra newline that the text widget always adds. 2013-02-12T02:12:58.883Z+00:00 ... Thanks! Just out of curiosity, if I were to write end+1c would that add a new line to the code? Lastly, Bryan and Honest Abe, thank you guys so much for helping me out with my simple Tkinter ... More on stackoverflow.com
🌐 stackoverflow.com
Tkinter text.insert()
How does text or insert() on the text widget work? I thought that with string parameters indicating line and column text string could be placed in whatever part of the window, e.g. via: text = tk.Text(okno, height=10) text.insert("5.3", f"Toto je test") text.pack(expand=True, fill = "both") ... More on discuss.python.org
🌐 discuss.python.org
7
0
January 30, 2024
How to display a complete text in Tkinter GUI in python? - Stack Overflow
I am creating a project that by the press of a button a text from another function will appear in GUI under that button . The text is a function's result saved in a list. I want to display the full More on stackoverflow.com
🌐 stackoverflow.com
Edit text widgets in Tkinter
The text argument is not used by Text widgets. Some other widgets, like Labels, Buttons, and LabelFrames use that argument, but it's not universal. To insert text into a Text widget you use the insert method, and you tell it where you want the text inserted. To do it on a disabled widget you just have to temporarily enable it. info.config(state=tk.NORMAL) info.delete('1.0', tk.END) # optional: clear out all data from the Text widget first info.insert(tk.END, "New data") info.config(state=tk.DISABLED) Edit: an MCVE for you: import time import tkinter as tk def updateinfo(): info.config(state=tk.NORMAL) # ~ info.delete('1.0', tk.END) # optional: clear out all data from the Text widget first info.insert(tk.END, time.strftime("The current unix time is: %s\n")) info.config(state=tk.DISABLED) info = tk.Text(state=tk.DISABLED) info.pack() btn = tk.Button(text="click me!", command=updateinfo) btn.pack() tk.mainloop() More on reddit.com
🌐 r/learnpython
2
1
May 13, 2022
🌐
Python Course
python-course.eu › tkinter › text-widget-in-tkinter.php
10. Text Widget in Tkinter | Tkinter | python-course.eu
We can apply the method insert() on the object T, which the Text() method had returned, to include text. We add two lines of text. import tkinter as tk root = tk.Tk() T = tk.Text(root, height=2, width=30) T.pack() T.insert(tk.END, "Just a text Widget\nin two lines\n") tk.mainloop()
🌐
Python Tutorial
pythontutorial.net › home › tkinter tutorial › tkinter text
Tkinter Text - Python Tutorial
April 4, 2025 - In this example, the delete() function clears all text from the widget by specifying the range '1.0' to tk.END. Here are some configurations you can use to change the appearance of the Text widget: ... import tkinter as tk from tkinter import ttk from tkinter.messagebox import showinfo root = tk.Tk() root.title("Text Widget Example") text = tk.Text(root, height=8) text.config( font=("Consolas", 12), fg="#F0F0F0", bg="#282C34", insertbackground="white" ) text.pack(padx=10, pady=10, expand=True,fill=tk.BOTH) text.insert( index='1.0', chars= 'This is a Text widget demo' ) root.mainloop()Code language: JavaScript (javascript)
🌐
TkDocs
tkdocs.com › tutorial › text.html
TkDocs Tutorial - Text
Users don't edit the text widget at all. Instead, the program writes log messages to it. We'd like to display more than 24 lines (so no scrolling). If the log is full, old messages are removed from the top before new ones are added at the end. from tkinter import * from tkinter import ttk root ...
Find elsewhere
🌐
Dafarry
dafarry.github.io › tkinterbook › text.htm
The Tkinter Text Widget
You can use any number of user-defined marks in a text widget. Mark names are ordinary strings, and they can contain anything except whitespace (for convenience, you should avoid names that can be confused with indexes, especially names containing periods). To create or move a mark, use the mark_set method. Two marks are predefined by Tkinter, and have special meaning:
🌐
Javatpoint
javatpoint.com › python-tkinter-text
Python Tkinter Text - Javatpoint
Python Tkinter Text with python tutorial, tkinter, button, overview, entry, checkbutton, canvas, frame, environment set-up, first python program, basics, data types, operators, etc.
🌐
Stack Overflow
stackoverflow.com › questions › 58199612 › how-to-display-a-complete-text-in-tkinter-gui-in-python
How to display a complete text in Tkinter GUI in python? - Stack Overflow
You should use tkinter.Text(). ... This displays the text and wraps the lines if too long. ... Sign up to request clarification or add additional context in comments.
🌐
DZone
dzone.com › coding › languages › python: how to create text widgets using tkinter library
Python: How to Create Text Widgets Using Tkinter Library
November 19, 2024 - To make it active (that is, ready to accept text), make a mouse click in the text area. Next, enter the following text: Tkinter Programming.
🌐
Educative
educative.io › answers › how-to-make-a-text-box-in-tkinter
How to make a text box in Tkinter
#import tkinter module import tkinter as tk #create window window = tk.Tk() #provide size to window window.geometry("300x300") #add text label tk.Label(text="Enter Name").pack() #add text box tk.Entry().pack() window.mainloop() Line 2: We import the tkinker module. Line 5: We create a tkinker instance and assign it to the variable window.
🌐
Reddit
reddit.com › r/learnpython › edit text widgets in tkinter
r/learnpython on Reddit: Edit text widgets in Tkinter
May 13, 2022 -

So, i was trying to remake a tic-tac-toe game in python after i lost my original program, but to make things different, i wanted to make ui.

Things were going well, i followed online tutorials and the program was coming along quite nicely.

But then i just hit a big unexpected roadblock with text widgets(I hope that's their name)

I wanted to make one you couldn't edit, but while a bit searching made me find that, i couldn't find any way to edit them(as in, run a function to change it's text). I searched tons of times, tried swapping to google, but it didn't work.

Does anybody know how to do this? Here is an attempt of trying to do it myself and the error message that came up:

info.config(text="placeholder")

i tried doing the same thing as disabling editing, which is done like this:

info.config(state="disabled")

But i just returned an error:

Exception in Tkinter callback
Traceback (most recent call last):
  File "file directory.py", line 1892, in __call__
    return self.func(*args)
  File "file directory.py", line 10, in b1
    btn_pressed(1)
  File "file directory.py", line 8, in btn_pressed   
    info.config(text="placeholder")
  File "file directory.py", line 1646, in configure
    return self._configure('configure', cnf, kw)
  File "file directory.py", line 1636, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-text"

#don't worry about that "file directory", i just replaced everything before .py with it
#also, it is located in a function caled by another function(done because i couldn't find a way to define arguments with buttons).

Any help would be greatly apreciated!

🌐
15. The Menu widget
anzeljg.github.io › rin2 › book2 › 2405 › docs › tkinter › text.html
24. The Text widget
Text widgets are a much more generalized method for handling multiple lines of text than the Label widget. Text widgets are pretty much a complete text editor in a window:
🌐
Tk Tutorial
tk-tutorial.readthedocs.io › en › latest › text › text.html
Text — Tk tutorial 2020 documentation - Read the Docs
They move with the text. """Widgets inside Text""" from tklib import * def hello(): print('hello') class Demo(App): def __init__(self): super().__init__() Label("Widgets inside Text", font="Arial 18") App.text = Text(str, height=10, width=50) b = ttk.Button(App.text, text='Push me', command=hello, padding=10) App.text.window_create('1.0', window=b) Demo().run()
🌐
w3resource
w3resource.com › python-exercises › tkinter › python-tkinter-widgets-exercise-7.php
Python tkinter widgets: Create a Text widget using tkinter module - w3resource
import tkinter as tk parent = tk.Tk() # create the widget. mytext = tk.Text(parent) # insert a string at the beginning mytext.insert('1.0', "- Python exercises, solution -") # insert a string into the current text mytext.insert('1.19', ' Practice,') # delete the first and last character (including a newline character) mytext.delete('1.0') mytext.delete('end - 2 chars') mytext.pack() parent.mainloop()
🌐
TkDocs
tkdocs.com › pyref › text.html
TkDocs - Text
Text widget which can display text in various forms. Tkinter Class API Reference Contents ·
🌐
15. The Menu widget
anzeljg.github.io › rin2 › book2 › 2405 › docs › tkinter › text-methods.html
24.8. Methods on Text widgets
If you want to apply one or more tags to the text you are inserting, provide as a third argument a tuple of tag strings. Any tags that apply to existing characters around the insertion point are ignored. Note: The third argument must be a tuple. If you supply a list argument, Tkinter will silently ...
🌐
Studytonight
studytonight.com › tkinter › python-tkinter-text-widget
Python Tkinter Text Widget - Studytonight
August 24, 2020 - This tutorial covers the Tkinter text widget with its syntax, options, and methods of mark and tag handling along with a code example for Tkinter Text widget.