Just grab a new iterator. Any reason you want to reuse the same iteratror. On 21/10/2013 11:44 PM, "Stefano Masera" <[email protected]> wrote:
> Hi list, > I use an iterator two times in a python code and I have to reset it to the > starting point before to recall it. > > # 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-user mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-user >
_______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
