The shelve module can be easily used. How to Read a File Not only you can create.
Usually a file is kept on a permanent storage media, e. Gives me a reason to dive into the Linux Bible. Each line contains the name of the city, followed by the name of the day "Sun" and the time in the form hh:mm. So casting should work for me and that's probably the most efficient way to handle it.
Reading in one go So far we worked on files line by line by using a for loop. Let's imagine this data object is a dictionary. Not sure if it can do that But what about pickling multiple objects? Objects which have been dumped to a file with pickle. In our first example we want to show how to read data from a file.
These modes also define the location of the File Handle in the file.