title: Overwriting a specific row in a csv file using Python's CSV module
body: <p>I'm using Python's csv module to do some reading and writing of csv files. </p>
  
  <p>I've got the reading fine and appending to the csv fine, but I want to be able to overwrite a specific row in the csv. </p>
  
  <p>For reference, here's my reading and then writing code to append:</p>
  
  <pre><code>    #reading
      b = open("bottles.csv", "rb")
      bottles = csv.reader(b)
      bottle_list = []
      bottle_list.extend(bottles)
      b.close()
  
      #appending
      b=open('bottles.csv','a')
      writer = csv.writer(b)
      writer.writerow([bottle,emptyButtonCount,100, img])
      b.close()
  </code></pre>
  
  <p>And I'm using basically the same for the overwrite mode(which isn't correct, it just overwrites the whole csv file): </p>
  
  <pre><code>    b=open('bottles.csv','wb')
      writer = csv.writer(b)
      writer.writerow([bottle,btlnum,100,img])
      b.close()
  </code></pre>
  
  <p>In the second case, how do I tell Python I need a specific row overwritten? I've scoured Gogle and other stackoverflow posts to no avail. I assume my limited programming knowledge is to blame rather than Google.</p>