Text() widget in tkinter python by R4R Team

- Text() is a python tkinter widget that create a input field block for the user to enter their data.
-Entry() and Text() widget work same
-but Text() widget hold large data while Entry() widget hold only one line data.

Syntax-

t=Text(window,option,....)


program-

from tkinter import *
#create a window screen
win=Tk()
win.geometry("400x350")

def call():
data=t.get("1.0",END)
l1.config(text=data)

l=Label(win,text="Enter Address",font=('',20,''))
l.place(x=70,y=0)

#create text field
t=Text(win,heigh=10,width=30)
t.place(x=70,y=50)

b=Button(win,text="Click",command=call,font=('',10,''),bd=5)
b.place(x=70,y=240)

l1=Label(win)
l1.place(x=70,y=280)

#hold the screen
win.mainloop()


output-




-In this program, we create a Text() widget over the window screen shown in above output.
-but when we put some data inside it and click on button then output is :-





Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!