title: Preserving styles using python's xlrd,xlwt, and xlutils.copy
body: <p>I'm using <code>xlrd</code>, <code>xlutils.copy</code>, and <code>xlwt</code> to open up a template file, copy it, fill it with new values, and save it.</p>
  
  <p>However, there doesn't seem to be any easy way to preserve the formatting of the cells; it always gets blown away and set to blank.  Is there any simple way I can do this?</p>
  
  <p>Thanks!
  /YGA</p>
  
  <p>A sample script:</p>
  
  <pre><code>from xlrd import open_workbook
  from xlutils.copy import copy
  rb = open_workbook('output_template.xls',formatting_info=True)
  rs = rb.sheet_by_index(0)
  wb = copy(rb)
  ws = wb.get_sheet(0)
  for i,cell in enumerate(rs.col(8)):
      if not i:
          continue
      ws.write(i,2,22,plain)
  wb.save('output.xls')
  </code></pre>
  
  <p>Versions:</p>
  
  <ul>
  <li><code>xlrd</code>: 0.7.1</li>
  <li><code>xlwt</code>: 0.7.2</li>
  </ul>