How to write a file generator

sturlamolden sturlamolden at yahoo.no
Tue Jul 12 18:53:23 CEST 2011


On 12 Jul, 16:46, Billy Mays <no... at nohow.com> wrote:

> I know the problem lies with the StopIteration, but I'm not sure how to
> tell the caller that there are no more lines for now.

Try 'yield None' instead of 'raise StopIteration'.

Sturla





More information about the Python-list mailing list