StringIO.getvalue()
StringIO.getvalue() is a Python method in the IO Module category. Returns the entire contents of the StringIO buffer as a string. The syntax is StringIO.getvalue(). Returns: String. A typical example: out = buf.getvalue(). A close sibling is io.StringIO(), which creates an in-memory text stream (like a file for string I/O). A close sibling is io.BytesIO(), which creates an in-memory binary stream (like a file for bytes I/O). A close sibling is StringIO.seek(), which changes the stream position to the given offset. A close sibling is StringIO.truncate(), which truncates the stream to the specified size. More about this category: Stream handling — StringIO, BytesIO for in-memory I/O. Related IO Module entries: io.StringIO(), io.BytesIO(), StringIO.seek(), StringIO.truncate(), StringIO.close(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try StringIO.getvalue() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.