too perhaps worst of allthe formatted text file scheme is already complex without being generalit is tied to the dictionary-of-dictionaries structureand it can' handle anything else without being greatly expanded it would be nice if general tool existed that could translate any sort of python data to format that could be saved in file in single step that is exactly what the python pickle module is designed to do the pickle module translates an in-memory python object into serialized byte stream-- string of bytes that can be written to any file-like object the pickle module also knows how to reconstruct the original object in memorygiven the serialized byte streamwe get back the exact same object in sensethe pickle module replaces proprietary data formats --its serialized format is general and efficient enough for any program with picklethere is no need to manually translate objects to data when storing them persistentlyand no need to manually parse complex format to get them back pickling is similar in spirit to xml representationsbut it' both more python-specificand much simpler to code the net effect is that pickling allows us to store and fetch native python objects as they are and in single step--we use normal python syntax to process pickled records despite what it doesthe pickle module is remarkably easy to use example - shows how to store our records in flat fileusing pickle example - pp \preview\make_db_pickle py from initdata import db import pickle dbfile open('people-pickle''wb'pickle dump(dbdbfiledbfile close(use binary mode files in data is bytesnot str when runthis script stores the entire database (the dictionary of dictionaries defined in example - to flat file named people-pickle in the current working directory the pickle module handles the work of converting the object to string example - shows how to access the pickled database after it has been createdwe simply open the file and pass its content back to pickle to remake the object from its serialized string example - pp \preview\dump_db_pickle py import pickle dbfile open('people-pickle''rb'db pickle load(dbfilefor key in dbprint(key'=>\ 'db[key]print(db['sue']['name']use binary mode files in here are these two scripts at workat the system command line againnaturallythey can also be run in idleand you can open and inspect the pickle file by running the same sort of code interactively as well sneak preview