it path object after running the previous code on windowsyou will see three new files in the current working directorymydata bakmydata datand mydata dir on macosonly single mydata db file will be created these binary files contain the data you stored in your shelf the format of these binary files is not importantyou only need to know what the shelve module doesnot how it does it the module frees you from worrying about how to store your program' data to file your programs can use the shelve module to later reopen and retrieve the data from these shelf files shelf values don' have to be opened in read or write mode--they can do both once opened enter the following into the interactive shellshelffile shelve open('mydata'type(shelffileshelffile['cats'['zophie''pooka''simon'shelffile close(herewe open the shelf files to check that our data was stored correctly entering shelffile['cats'returns the same list that we stored earlierso we know that the list is correctly storedand we call close(just like dictionariesshelf values have keys(and values(methods that will return list-like values of the keys and values in the shelf since these methods return list-like values instead of true listsyou should pass them to the list(function to get them in list form enter the following into the interactive shellshelffile shelve open('mydata'list(shelffile keys()['cats'list(shelffile values()[['zophie''pooka''simon']shelffile close(plaintext is useful for creating files that you'll read in text editor such as notepad or texteditbut if you want to save data from your python programsuse the shelve module saving variables with the pprint pformat(function recall from "pretty printingon page that the pprint pprint(function will "pretty printthe contents of list or dictionary to the screenwhile the pprint pformat(function will return this same text as string instead of printing it not only is this string formatted to be easy to readbut it is also syntactically correct python code say you have dictionary stored in variable and you want to save this variable and its contents for future use using