\pp \previewpython dump_db_pickle py bob ={'pay' 'job''dev''age' 'name''bob smith'sue ={'pay' 'job''hdw''age' 'name''sue jones'tom ={'pay' 'job'none'age' 'name''tom'sue jones updating with pickle file is similar to manually formatted fileexcept that python is doing all of the formatting work for us example - shows how example - pp \preview\update-db-pickle py import pickle dbfile open('people-pickle''rb'db pickle load(dbfiledbfile close(db['sue']['pay'* db['tom']['name''tom tomdbfile open('people-pickle''wb'pickle dump(dbdbfiledbfile close(notice how the entire database is written back to the file after the records are changed in memoryjust as for the manually formatted approachthis might become slow for very large databasesbut we'll ignore this for the moment here are our update and dump scripts in action--as in the prior sectionsue' pay and tom' name change between scripts because they are written back to file (this timea pickle file)\pp \previewpython update_db_pickle py \pp \previewpython dump_db_pickle py bob ={'pay' 'job''dev''age' 'name''bob smith'sue ={'pay' 'job''hdw''age' 'name''sue jones'tom ={'pay' 'job'none'age' 'name''tom tom'sue jones as we'll learn in the python pickling system supports nearly arbitrary object types--listsdictionariesclass instancesnested structuresand more therewe'll also learn about the pickler' text and binary storage protocolsas of python all protocols use bytes objects to represent pickled datawhich in turn requires pickle files to be opened in binary mode for all protocols as we'll see later in this the pickler and its data format also underlie shelves and zodb databasesand pickled class instances provide both data and behavior for objects stored in factpickling is more general than these examples may imply because they accept any object that provides an interface compatible with filespickling and unpickling may step storing records persistently