Introduction

In this article, I will explain how to add entry in Tkinter in Python.
Definition
The Entry keyword is used for single-line text strings from a user. If you want to display multiple lines of text that can be edited, then you should use the Text widget.
Syntax
w = Entry( master, option, ... )
Parameters
a − This represents the parent window of the computer.
option − The list of most used options for this widget.

Option & Description

Program
  1. from tkinter
  2. import * login = Tk()
  3. login.title("Login")
  4. login.geometry("300x250")
  5. Label(login, text = "Username", bg = "pink", bd = 10, \fg = "black", font = "Castellar").pack()
  6. username = Entry(login, textvariable = "username", \bg = "green", bd = 10, fg = "white", font = "Castellar", cursor = "target")
  7. username.pack()
  8. Label(login, text = "Password", bg = "pink", bd = 10, \fg = "black", font = "Castellar").pack()
  9. password = Entry(login, textvariable = "password", \show = '*', bg = "green", bd = 10, fg = "white", font = "Castellar", cursor = "target")
  10. password.pack()
  11. Button(login, text = "Login", width = 10, height = 1, bg = "red", cursor = "watch").pack()
  12. login.mainloop()
Output
How To Add Entry In Tkinter In Python
Program
  1. from tkinter
  2. import * a = Tk()
  3. a.geometry("400x400")
  4. a.title("test")
  5. def hello(): a.configure(bg = "red")
  6. a.configure(bd = 10)
  7. L1 = Label(a, text = "c# corner").pack()
  8. b = Button(a, text = "click me!", command = hello).pack()
  9. a.mainloop()
Output
How To Add Entry In Tkinter In Python
Program
  1. from tkinter
  2. import * a = Tk()
  3. a.geometry("400x400")
  4. a.title("test")
  5. Label(a, text = "Username").pack()
  6. username = Entry(a, textvariable = "username", \state = DISABLED, justify = CENTER, relief = "solid", width = 10)
  7. username.pack()
  8. a.mainloop()
Output
How To Add Entry In Tkinter In Python

Conclusion

In this article, we have seen how to add an entry in Tkinter in Python. I hope this article was useful to you. Thanks for reading.