First, basic function chapter
1) Description of Python strip () function
Function prototypes
Declaration: S is a string, RM is a sequence of characters to be deleted
S.strip (RM) Remove the characters from the beginning and end of the s string in the RM delete sequence
S.lstrip (RM) Delete the character in the S string at the beginning of the RM delete sequence
S.rstrip (RM) Removes the character from the end of the S string that is located in the RM delete sequence
Note: When RM is empty, the default is to remove the white space character (including ' \ n ', ' \ R ', ' \ t ', ')
2) Python ReadLine (), ReadLines () Introduction
ReadLine () reads only one line of the file, a character reads one character, and one character returns or writes one character.
ReadLines () reads the entire file, one line at a time, and one line at a time.
Note: The difference between ReadLines (Sizeint) and ReadLines () [Int1:int2]
ReadLines (Sizeint) each time the ReadLines (sizeint) function is called, it returns approximately sizeint data, and the return is necessarily the complete row data, in most cases, the number of bytes returned is slightly higher than the Sizeint The specified value is a little larger (except when the last call to the ReadLines (sizehint) function). Typically, Python automatically adjusts the value of the user-specified sizeint to an integer multiple of the internal cache size.
ReadLines () [Int1:int2] returns rows of data from Int1 to Int2.
Python Data processing