io.TextIOBase.write()

write(s) Write the string s to the stream and return the number of characters written.

io.TextIOBase.tell()

tell() Return the current stream position as an opaque number. The number does not usually represent a number of bytes in the underlying binary storage.

io.TextIOBase.seek()

seek(offset[, whence]) Change the stream position to the given offset. Behaviour depends on the whence parameter. The default value for whence is SEEK_SET. SEEK_SET or 0: seek from the start of the stream (the default); offset must either be a number returned by TextIOBase.tell(), or zero. Any other offset value produces undefined behaviour. SEEK_CUR or 1: “seek” to the current position; offset must be zero, which is a no-operation (all other values are unsupported). SEEK_END or 2: seek t

io.TextIOBase.readline()

readline(size=-1) Read until newline or EOF and return a single str. If the stream is already at EOF, an empty string is returned. If size is specified, at most size characters will be read.

io.TextIOBase.read()

read(size) Read and return at most size characters from the stream as a single str. If size is negative or None, reads until EOF.

io.TextIOBase.newlines

newlines A string, a tuple of strings, or None, indicating the newlines translated so far. Depending on the implementation and the initial constructor flags, this may not be available.

io.TextIOBase.errors

errors The error setting of the decoder or encoder.

io.TextIOBase.encoding

encoding The name of the encoding used to decode the stream’s bytes into strings, and to encode strings into bytes.

io.TextIOBase.detach()

detach() Separate the underlying binary buffer from the TextIOBase and return it. After the underlying buffer has been detached, the TextIOBase is in an unusable state. Some TextIOBase implementations, like StringIO, may not have the concept of an underlying buffer and calling this method will raise UnsupportedOperation. New in version 3.1.

io.TextIOBase.buffer

buffer The underlying binary buffer (a BufferedIOBase instance) that TextIOBase deals with. This is not part of the TextIOBase API and may not exist in some implementations.