nikhil Pandey wrote:
> On Wednesday, September 18, 2013 5:14:10 PM UTC+5:30, Peter Otten wrote:
> I want to iterate in the inner loop by reading each line till some
> condition is met.how can i do that. Thanks for this code.
That's not what I had in mind when I asked you to
>> describe your actual requirement in more detail.
Anyway, change
[...]
>> f, g = tee(f)
>> for inner in islice(g, 3):
>> print " ", inner,
>> break
[...]
to
f, g = tee(f)
for inner in g:
if some condition:
break
print " ", inner,
break
in my example.
--
https://mail.python.org/mailman/listinfo/python-list