eval to convert field values to python objects before they are stored in the shelve as mentioned previouslythis is potentially dangerous if someone sneaks some malicious code into our shelvebut we'll finesse such concerns for now keep in mindthoughthat this scheme means that strings must be quoted in input fields other than the key--they are assumed to be python code in factyou could type an arbitrary python expression in an input field to specify value for an update typing "tom"* in the name fieldfor instancewould set the name to tomtomtom after an update (for better or worse!)fetch to see the result even though we now have gui for browsing and changing recordswe can still check our work by interactively opening and inspecting the shelve file or by running scripts such as the dump utility in example - rememberdespite the fact that we're now viewing records in gui' windowsthe database is python shelve file containing native python class instance objectsso any python code can access it here is the dump script at work after adding and changing few persistent objects in the gui\pp \previewpython dump_db_classes py sue =sue jones bill =bill nobody =john doh none tomtom =tom tom tom =tom doe bob =bob smith peg = smith doe future directions although this gui does the jobthere is plenty of room for improvementas codedthis gui is simple set of functions that share the global list of input fields (entriesand global shelve (dbwe might instead pass db in to makewidgetsand pass along both these two objects as function arguments to the callback handlers using the lambda trick of the prior section though not crucial in script this smallas rule of thumbmaking your external dependencies explicit like this makes your code both easier to understand and reusable in other contexts we could also structure this gui as class to support attachment and customization (globals would become instance attributes)though it' unlikely that we'll need to reuse such specific gui step adding gui