Frankenstring

Thomas Lotze thomas at thomas-lotze.de
Wed Jul 13 12:56:49 CEST 2005


Peter Otten wrote:

>>>> class frankenstring(StringIO):
> ...     def next(self):
> ...             c = self.read(1)
> ...             if not c:
> ...                     raise StopIteration
> ...             return c

Repeated read(1) on a file-like object is one of the ways of doing it with
existing tools I labelled "clumsy" in the original posting ;o)

Thanks anyway.

-- 
Thomas




More information about the Python-list mailing list