Module cStringIO
[hide private]
[frames] | no frames]

Module cStringIO

A simple fast partial StringIO replacement.

This module provides a simple useful replacement for
the StringIO module that is written in C.  It does not provide the
full generality of StringIO, but it provides enough for most
applications and is especially useful in conjunction with the
pickle module.

Usage:

  from cStringIO import StringIO

  an_output_stream=StringIO()
  an_output_stream.write(some_stuff)
  ...
  value=an_output_stream.getvalue()

  an_input_stream=StringIO(a_string)
  spam=an_input_stream.readline()
  spam=an_input_stream.read(5)
  an_input_stream.seek(0)           # OK, start over
  spam=an_input_stream.read()       # and read it all
  
If someone else wants to provide a more complete implementation,
go for it. :-)  

cStringIO.c,v 1.29 1999/06/15 14:10:27 jim Exp

Classes [hide private]
InputType
Simple type for treating strings as input file streams
OutputType
Simple type for output to strings.
Functions [hide private]
 
StringIO(s=...)
Return a StringIO-like stream for reading or writing
Variables [hide private]
  cStringIO_CAPI = <PyCObject object at 0x401984d0>