[EMAIL PROTECTED] wrote:

> Arnaud Delobelle <[EMAIL PROTECTED]> wrote:

>> You could use an iterator over the lines of the file:
>> 
>> def recfun(lines):
>>     for line in lines:
>>         # Do stuff
>>         if condition:
>>             recfun(lines)
>> 
>> lines = iter(open(filename))
>> recfun(lines)

> Does that work though?  If you iterate through the file with the "for
> line in lines:" in the first call of recfun(lines) you surely can't do
> "for line in lines:" and get any sort of sensible result in recursive
> calls of recfun(lines) can you?

Don't speculate, try it.

Peter 

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to