tkinter.Entry.pack


Definition
The method create new Entry.

Syntax
tkinter.Entry().pack()

Parameters
None

Options
  • Entry.pack(
  • after=widget - pack it after you have packed widget
  • anchor=NSEW (or subset) - position widget according to given direction
  • before=widget - pack it before you will pack widget
  • expand=bool - expand widget if parent size grows
  • fill=NONE or X or Y or BOTH - fill widget if widget grows
  • in=master - use master to contain this widget
  • in_=master - see 'in' option description
  • ipadx=amount - add internal padding in x direction
  • ipady=amount - add internal padding in y direction
  • padx=amount - add padding in x direction
  • pady=amount - add padding in y direction
  • side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget.
  • )
Examples
The method deleted the entered text through button option(command)
from tkinter import*

master=Tk()

def e1_delete():
    e1.delete(first=0,last=22)

e1=Entry(master, width=20)

B=Button(master, text="Submit", command=e1_delete)
B.pack()

master.mainloop











Comments