Does iterator.rewind() return True?

2013/10/23 Stefano Masera <stefano.mas...@arpa.piemonte.it>

> Hi list,
> I use an iterator two times in a python code and I wantto reset it to the
> starting point before to reuse it.
> In this way I hope to be more quick.
>
> # first use of the iterator
> iterator = layer.dataProvider().getFeatures()
> for feature in iterator:
> #  operations
> # than, a second time I have to use the operator, in a following part of
> the code:
> for feature in iterator:
> #  other operations
>
> But it doesn't start from the first feature!
>
> I try with:
> iterator.rewind()
> between the two blocks, but it doesn't work.
>
> Thanks.
>
> Stefano Masera
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Giovanni Allegri
http://about.me/giovanniallegri
blog: http://blog.spaziogis.it
GEO+ geomatica in Italia http://bit.ly/GEOplus
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to