Jul-01-2021, 10:37 PM
Please post your code as text (using the python tags or buttons in the editor), not as images.
An open file only has one file pointer. If you open a file for both reading and writing and you write 200 bytes of encoded data, the file pointer will be at byte 200 of the file.
If you then attempt to read with nothing else done, you will be reading from that point in the file. If there is no more data past that point, then the
You can reset back to the beginning by closing and re-opening the file, or by calling
An open file only has one file pointer. If you open a file for both reading and writing and you write 200 bytes of encoded data, the file pointer will be at byte 200 of the file.
If you then attempt to read with nothing else done, you will be reading from that point in the file. If there is no more data past that point, then the
read()
will return an empty string.You can reset back to the beginning by closing and re-opening the file, or by calling
seek()
method on the file.