guithe shelve remains open for the lifespan of the gui (mainloop returns only after the main window is closedas we'll see in the next sectionthis state retention is very different from the web modelwhere each interaction is normally standalone program also notice that the use of global variables makes this code simple but unusable outside the context of our databasemore on this later using the gui the gui we're building is fairly basicbut it provides view on the shelve file and allows us to browse and update the file without typing any code to fetch record from the shelve and display it on the guitype its key into the gui' "keyfield and click fetch to change recordtype into its input fields after fetching it and click updatethe values in the gui will be written to the record in the database and to add new recordfill out all of the gui' fields with new values and click update--the new record will be added to the shelve file using the key and field inputs you provide in other wordsthe gui' fields are used for both display and input figure - shows the scene after adding new record (via update)and figure - shows an error dialog pop up issued when users try to fetch key that isn' present in the shelve figure - peoplegui py after adding new persistent object figure - peoplegui py common error dialog pop up sneak preview