['bob smith''sue jones'and to add new recordsimply assign it to new keythis is just dictionaryafter alldb['tom'dict(name='tom'age= job=nonepay= db['tom'{'pay' 'job'none'age' 'name''tom'db['tom']['name''tomlist(db keys()['bob''sue''tom'len(db [rec['age'for rec in db values()[ [rec['name'for rec in db values(if rec['age'> ['sue jones''tom'sql-ish query although our database is still transient object in memoryit turns out that this dictionary-of-dictionaries format corresponds exactly to system that saves objects permanently--the shelve (yesthis should probably be shelfgrammatically speakingbut the python module name and term is shelveto learn howlet' move on to the next section step storing records persistently so farwe've settled on dictionary-based representation for our database of recordsand we've reviewed some python data structure concepts along the way as mentionedthoughthe objects we've seen so far are temporary--they live in memory and they go away as soon as we exit python or the python program that created them to make our people persistentthey need to be stored in file of some sort using formatted files one way to keep our data around between program runs is to write all the data out to simple text filein formatted way provided the saving and loading tools agree on the format selectedwe're free to use any custom scheme we like test data script so that we don' have to keep working interactivelylet' first write script that initializes the data we are going to store (if you've done any python work in the pastyou know that the interactive prompt tends to become tedious once you leave the realm of simple one-linersexample - creates the sort of records and database dictionary we've been working with so farbut because it is modulewe can import it repeatedly without having to retype the code each time in sensethis module is database itselfbut its program code format doesn' support automatic or end-user updates as is sneak preview