Now something you should know is the
cursor concept. What happens here is
that when you create a file, file object is
created, and then when you apply the
read methods, before applying the read
method, the cursor stands at the very
first character of the text file. When
you apply the read methods, the cursor
goes to the end of the text file. So now
after the read method has been applied,
the cursor stands here. If you apply
another read operation, like that, Save,
execute. What's going to happen is that
maybe you were expecting these lines to
be printed out two times, what happens
instead is they are printed one time,
and then this is just an empty
string. Because the cursor after the
first execution of read was at this
point, and below this point, there's
nothing, so you get that empty string
there. What you can do is, if you want
to print the content many times, what
you can do is save the content
[No audio]
in a variable
and then print the content as many times
as you wish.
[No audio]
And you'll get the output
two times, as you can see here.
[No audio]
That's because the read method was
executed only once here.
So that's something you should know.
[No audio]