summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libstrio.tex
blob: 26fdda1255d9786a45e806faa5b3ca25093aee04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
\section{Standard Module \sectcode{StringIO}}
\label{module-StringIO}

\stmodindex{StringIO}

This module implements a file-like class, \code{StringIO},
that reads and writes a string buffer (also known as \emph{memory
files}). See the description on file objects for operations.

When a \code{StringIO} object is created, it can be initialized
to an existing string by passing the string to the constructor.
If no string is given, the \code{StringIO} will start empty.

The method \code{getvalue()} can be called to retrieve the entire
contents of the ``file'' at any time before the \code{StringIO}
object's \code{close()} method is called.  Calling \code{close()} will
free the memory buffer.