tkinter The Tkinter Entry Widget


  • entry = tk.Entry(parent, **kwargs)
  • entry.get()
  • entry.insert(index, "value")
  • entry.delete(start_index, end_index)
  • entry.bind(event, callback)


parenttkinter widgets exist in a hieararchy. Except for the root window, all widgets have a parent. Some online tutorials call this "master". When the widget is added to the screen with pack, place or grid, it will appear inside this parent widget
widthThe width specifies the desired width of the widget based on an average character width. For variable width fonts, this is based on the width of the zero character (0). The default is 20. Note that the actual width could be larger or smaller depending on how it is added to the screen.


These examples assume that tkinter has been imported with either import tkinter as tk (python 3) or import Tkinter as tk (python 2).