By checking the len attribute and using the getvalue() method
Type "help", "copyright", "credits" or "license" for more information.
>>> import StringIO
>>> s = StringIO.StringIO()
>>> s.write("foobar")
>>> s.len
6
>>> s.write(" and spameggs")
>>> s.len
19
>>> s.getvalue()
'foobar and spameggs'