on startupthe entry script fills the input field in this gui with the text "type words hereby calling the widget' insert method because both the fetch button and the enter key are set to trigger the script' fetch callback functioneither user event gets and displays the current text in the input fieldusing the widget' get methodc:\pp \gui\tourpython entry py input ="type words hereinput ="have cigarwe met the event earlier when we studied bindunlike button pressesthese lower-level callbacks get an event argumentso the script uses lambda wrapper to ignore it this script also packs the entry field with fill= to make it expand horizontally with the window (try it out)and it calls the widget focus method to give the entry field input focus when the window first appears manually setting the focus like this saves the user from having to click the input field before typing our smart quit button we wrote earlier is attached here again as well (it verifies exitprogramming entry widgets generally speakingthe values typed into and displayed by entry widgets are set and fetched with either tied "variableobjects (described later in this or entry widget method calls such as this oneent insert( 'some text'value ent get(set value fetch value ( stringthe first parameter to the insert method gives the position where the text is to be inserted here" means the front because offsets start at zeroand integer and string ' mean the same thing (tkinter method arguments are always converted to strings if neededif the entry widget might already contain textyou also generally need to delete its contents before setting it to new valueor else new text will simply be added to the text already presentent delete( endent insert( 'some text'firstdelete from start to end then set value the name end here is preassigned tkinter constant denoting the end of the widgetwe'll revisit it in when we meet the full-blown and multiple-line text widget (entry' more powerful cousinsince the widget is empty after the deletionthis statement sequence is equivalent to the prior one tkinter tourpart