<div dir="ltr"><div><div><div>OK, I found it !<br><br><br> iter = layer.getFeatures()<br>
for feat in iter:<br> fff = feat.fields()<br> num = fff.count()<br> for iii in range(num):<br> print "%s " %(feat[iii])<br>
<br><br></div>But... what about to have the field names ?<br><br></div>Thank you<br><br></div>Roberto<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/23 Geo DrinX <span dir="ltr"><<a href="mailto:geodrinx@gmail.com" target="_blank">geodrinx@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hello all,<br><br></div>I have difficulties writing the python code to print the field value contents from a feature.<br>
<br></div>This is my source code:<br><br> iter = layer.getFeatures()<br>
for feat in iter:<br> fff = feat.fields()<br> num = fff.count()<br> print "num %d\n" %(num)<br> for iii in range(num):<br>
fieldValue = fff[iii]<br> print "%s\n" %(fieldValue)<br><br></div>but this is what I had:<br><br><qgis.core.QgsField object at 0x000000000BF95268><br><br></div>
etcetera....<br><br><br></div>What I need to modify in the source code to have the correct string values ?<br><br></div>Sorry, but the 2.0 documentation is not so clear... actually :(<br><br><br></div><div>Thank you in advance for any info about this<br>
</div><div><br></div>Roberto <br></div>
</blockquote></div><br></div>