How to write a file generator

sturlamolden sturlamolden at
Tue Jul 12 18:53:23 CEST 2011

On 12 Jul, 16:46, Billy Mays <no... at> 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'.


More information about the Python-list mailing list