| Home | Trees | Index | Help |
|
|---|
| Module vopu :: Class StringStream |
|
object --+
|
StringStream
Stream which writes into a byte string.
>>> stream = StringStream()
>>> stream.content
''
>>> stream.write("foo")
>>> stream.content
'foo'
>>> stream.write("bar")
>>> stream.content
'foobar'
>>> print >>stream, "spam"
>>> stream.content
'foobarspam\n'
>>> str(stream)
'foobarspam\n'
>>> stream.content = "new content" >>> print >>stream, "Z" >>> print >>stream, "Line2" >>> stream.content 'new contentZ\nLine2\n'
| Method Summary | |
|---|---|
Create a new StringStream. | |
Return the content of this stream. | |
Write a string into this stream. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
| Method Details |
|---|
__init__(self,
content='',
*args,
**kwargs)
|
__str__(self)
|
write(self, str)Write a string into this stream. That means, append the given string to this stream's content.
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Sun Aug 31 15:41:30 2008 | http://epydoc.sf.net |