Writing Python Objects by formatting a text file is a possible option Refer Here
Storing Native Python Objects: pickle
The pickle module performs what is known as object serialization
The process of writing the objects to file (serialization) is referred as pickle or pickling and the process of reading objects into memory from file (deserialization) is referred as unpickling
Applying Pickle to samples and also to lt_restaurant is over here