Yesterday, we made a big change in our program.
We changed the way the data is stored because before yesterday the data was simply stored in variables
and that meant whenever the user closed the program, the data would get lost.
So the user experience couldn't be more terrible than that.
We change all that by storing the data in a text file.
And this too.
Does the text text file?
To implement that We did this changes in the code.
So when the user wants to add a to do, we get the to do from the user using an input function again
and then we see what existing to dos we have in the file.
So we open the file in read mode.
You see our here.
And we store the tattoos in a to do list.
So we need to have that list because later we append the user to do and this to this list.
And then, of course, this to do list has to be written back to the file.
To do that, we open the file in write mode.
And that's overwrites the existing file.
But that's okay, because we already have.
The content that the file had.
So we have it dos.
Therefore, we write the to do list in the file.
So now the to this list will contain the existing data plus the new to do which will was added in here.
And so we close the file here and we are done with that.
We also implemented this in the show methods and here we only wanted to read Delta, so we only open
the file and read mode.
As you can see in here.
We get the data in a to do list, we close the file and then we iterate over that to to list.
So to this list was created here.
We iterate in here and we print out the data as we did before.
So that's what we did previously.
We still have to make some important changes to our program.
We still have to improve it.
So let's improve it in the next videos today.
So you.