... while True: ... next = self.iter.peek() ... if not next or next.rstrip('\n') == "|": ... break ... yield self.iter.next() ...
Actually, the 'not next' test is not necessary since I'm using an iterator over the file (end of file is signified by StopIteration, not a value of '' returned by the iterator). The amended version:
... while True: ... next = self.iter.peek() ... if next.rstrip('\n') == "|": ... break ... yield self.iter.next()
Steve -- http://mail.python.org/mailman/listinfo/python-list