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