I am now have a shape file and I want to add value to fill it with color
but now I have a problem
http://www.qgis.org/pyqgis-cookbook/vector.html#add-features
feat = QgsFeature()
feat.addAttribute(0,"hello")
feat.setGeometry(QgsGeometry.fromPoint(QgsPoint(123,456)))
(res, outFeats) = layer.dataProvider().addFeatures( [ feat ] )
Here is the example for point,and now I have polygons and polylines
I want to know if I have polygon how to add feature to the shape file I select with python??