title: Sort in Python changing column order
body: <p>I am reading data from csv n storing in dict... colName:Value ... format...
  but order of cols get messed..
  I want in same order as csv</p>
  
  <p>Code:</p>
  
  <pre><code>def sort_csv():
  
      data = list(csv.DictReader(open("Bl.csv")))
      op = open("Bl_S.csv", "wb")
      wr = csv.writer(op, quoting=csv.QUOTE_NONE)
  
      sorted_data = sorted(data, key = lambda d:(d['ID'], d['Begin']))
      headers = sorted_data[0].keys()
      wr.writerow(headers)
      for i in sorted_data:
           wr.writerow(i.values())
  
      op.close()
  </code></pre>