title: Adding custom Feature attributes to ESRI Shapefile with Python
body: <p>I am seeking a way to take an existing ESRI Shapefile that has a Feature set of 200 countries. Each country Feature has an attribute of "NAME." My objective is to create a Python script that adds an arbitrary (for now) additional attribute, say, "POPULATION".</p>
  
  <p>Of course I have the OSGeo and GeoDjango modules installed. I'm as far as:</p>
  
  <pre><code>from osgeo import ogr
  
  infile = ogr.Open('sample.shp', 1) #'sample.shp' is a pre-existing ESRI shapefile described above
  inlyr = infile.GetLayerByIndex(0)
  </code></pre>
  
  <p>Am I missing an OGR function that will allow me to insert Feature attribute fields into an existing Shapefile?</p>