Entry field in Tkinter in python by R4R Team

The Entry widget in Tkinter is used to accept single-line text strings from a user.
-Entry widget accept all type of type of input like string, alphabet, number and special character.
-StringVar() and IntVar() are used to declared a string and integer variable.


Syntax-

e=Entry(window,option=value)

Show the Design of Entry Widget-
program-



from tkinter import *
#create a window screen
win=Tk()

#show text on screen
l=Label(win,text="Enter Value")
l.place(x=40,y=100)

#Entry field at user side
e=Entry(win)
e.place(x=40,y=140)

#Create button
b=Button(win,text="Submit")
b.place(x=60,y=180)

#hold the screen
win.mainloop()


output-




-In this program, we firstly create a window screen that works as a platform for other widget, then we create a Label,Button along with the Entry field.
-Here e.place(x,y) place a Entry widget at (40, 140) coordinates.
-In above Entry widget is empty,

Put some content in Entry field, 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!