Python file operation Seek () and telll () self-explanatory
File.seek () method format: Seek (offset,whence=0) Move file read pointer to set position
Offset: The starting offset, which represents the number of bytes that need to move the offset.
Whence: A definition of the offset parameter that indicates which position to start the offset from, 0 for the beginning of the file, 1 for starting from the current position, and 2 for starting from the end of the file. When there is a newline, it is truncated by line breaks. Seek () No return value, so the value is None
Tell (): The current position of the liberal arts file, that is, tell is to get the file pointer position.
ReadLine (N): reads in several rows, and n represents the maximum number of bytes read in.
ReadLines (): reads the contents of all rows
Read reads the contents of all rows
Tell (): Returns the location of the file read pointer
The main 3 modes of Seek are:
(1) F.seek ()
Python file operation Seek () and telll () self-explanatory