Thomas Lotze wrote: > 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)
Not clumsy, just slow. I hope you'll let us know how much faster your final approach turns out to be. By the way, I'll consider anything that doesn't implement seek() and tell() cheating :-) Peter -- http://mail.python.org/mailman/listinfo/python-list