pg.io.File¶
Accessible via pg.io.File
.
- class File[source]¶
Bases:
object
Interface for a file.
Methods:
close
()Closes the file.
read
([size])Reads the content of the file.
readline
()Reads the next line.
seek
(offset[, whence])Changes the current position of the file.
tell
()Returns the current position of the file.
write
(content)Writes the content of the file.
- abstract seek(offset, whence=0)[source]¶
Changes the current position of the file.
- Return type:
- Parameters:
offset – Offset from the position to a reference point.
whence – The reference point, with 0 meaning the beginning of the file, 1 meaning the current position, or 2 meaning the end of the file.
- Returns:
The position from the beginning of the file.