TkinterServer Side ProgrammingProgramming

Tkinter text widget is much more than just a multiline text editor. It is useful for many applications where user interaction is required.

In order to configure the text widget, tkinter provides many functions and methods. Some of the features that we can add to style the text widgets are: changing the font-family, background-color, foreground-color, adding and selecting a particular text, changing font-size, and many more.

## Example

In this example, we will see how we can add different features to a particular text widget,

#Import tkinter library
from tkinter import *

#Create an instance of tkinter frame
win = Tk()

#Set the geometry of tkinter window
win.geometry("750x250")

#Create a text widget
text= Text(win, width= 50, height=14)

#Set default text for text widget
text.insert(INSERT, "Tkinter is a Python Library which is used to create various types of applications.")
text.insert(END, "Learning Tkinter is Awesome!!")

win.mainloop()