Posts

Showing posts with the label Seek

Python Tutorial 19 --- "Seek(), tell() & More On Python Files"

 Python Tutorial 19 ---  "Seek(), tell() & More On Python Files" This PROGRAM or TUTORIAL is  "Seek(), tell() & More On Python Files" DOC: Python file objects give us many methods and attribute that we can use to analyze a file, including tools to figure out the name of the file associated with the file object, whether it is closed or opened, writable, readable and how it handles errors. We have already discussed the file, its access modes, how to open, close, read, and write files in the previous tutorials. Now it is time to pay attention to some of the most useful and important functions used in file handling. In today’s tutorial, we are going to study why there is a need for tell() and seek() functions and how we can use them?  tell() When we are working with python files, there are several ways to present the output of a program, it could be in human-readable form or binary form, or we use read() function with specified sie to read some data. What if...