f = open (' Test.txt ', ' R ')
' R ':
' W ':
' X ':
' A ':
' R+ '
' w+ '
' A + '
| F.read ([size]) |
Reads a size byte that reads all remaining bytes when not specified or given a negative value, returning as a string |
| F.readline ([size]) |
Reads the next line from the file and returns it as a string. Returns a size byte if size is specified |
| F.readlines ([size]) |
Reads a size byte that reads all remaining bytes when not specified or given a negative value, returning as a list |
| F.write (str) |
Write String to File |
| F.writelines (seq) |
To write a sequence to a file, the SEQ must be an iterative object, and if a string sequence |
| F.seek (offset[, whence=0]) |
Move the file pointer in the file, from whence (0 for file start location, default. 1 represents the current position. 2 for the end of file) offsets offset bytes |
| F.tell () |
Returns the current position in the file |
F.close ()
|
Close File |
| F.flush |
Flush buffers to disk |
006--python file Operations