Python File (File) method
file functions to create objects using open, the following table lists the file objects commonly used functions:
|No.||Method and Description|
Close the file. Close the file can no longer read and write operations.
Internal refresh file buffering, the data directly to the internal buffer written to the file immediately, rather than passively waiting for output buffer written.
Return an integer file descriptor (file descriptor FD integer), it can be used in such a method os module read some of the underlying operations.
If the file is connected to a terminal device returns True, otherwise False.
Returns the file the next line.
Reads the specified number of bytes from the file, if not given or is negative read all.
Read the entire line, including the "\ n" character.
Read all rows and return a list, if given sizeint> 0, returns the sum of approximately sizeint byte row of the actual read value may be higher than sizhint larger, because of the need to fill the buffer.
Current position settings file
Returns the current file position.
Intercept file intercepted by byte size specified, it defaults to the current file position.
The string to the file, there is no return value.
Write a list of strings to the file sequence, if you need to change the line will have its own line breaks added for each row.