io.StringIO

class io.StringIO

Text I/O implementation using an in-memory buffer.

The initial_value argument sets the value of object. The newline argument is like the one of TextIOWrapper’s constructor.

Methods

__enter__
__exit__
__format__ default object formatter
__getstate__
__new__((S, ...)
__reduce__ helper for pickle
__reduce_ex__ helper for pickle
__setstate__
__sizeof__(() -> int) size of object in memory, in bytes
__subclasshook__ Abstract classes can override this to customize issubclass().
_checkClosed
_checkReadable
_checkSeekable
_checkWritable
close Close the IO object.
detach Separate the underlying buffer from the TextIOBase and return it.
fileno Returns underlying file descriptor if one exists.
flush Flush write buffers, if applicable.
getvalue Retrieve the entire contents of the object.
isatty Return whether this is an ‘interactive’ stream.
read Read at most n characters, returned as a string.
readable(...)
readline Read until newline or EOF.
readlines Return a list of lines from the stream.
seek Change stream position.
seekable(...)
tell Tell the current file position.
truncate Truncate size to pos.
writable(...)
write Write string to file.
writelines

Attributes

closed
encoding Encoding of the text stream.
errors The error setting of the decoder or encoder.
line_buffering
newlines
next