title: Python xlwt - accessing existing cell content, auto-adjust column width
body: <p>I am trying to create an Excel workbook where I can auto-set, or auto-adjust the widths of the columns before saving the workbook. </p>
  
  <p>I have been reading the Python-Excel tutorial in hopes of finding some functions in xlwt that emulate xlrd ones (such as <code>sheet_names()</code>, <code>cellname(row, col)</code>, <code>cell_type</code>, <code>cell_value</code>, and so on...) For example, suppose I have the following:</p>
  
  <pre><code>from xlwt import Workbook    
  wb = Workbook()
  sh1 = wb.add_sheet('sheet1' , cell_overwrite_ok = True)    
  sh2 = wb.get_sheet(0)
  </code></pre>
  
  <p><code>wb.get_sheet(0)</code> is similar to the <code>rb.sheet_by_index(0)</code> function offered in xlrd, except that the former allows you to modify the contents (provided the user has set <code>cell_overwrite_ok = True</code>)</p>
  
  <p>Assuming xlwt DOES offer the functions I am looking for, I was planning on going through every worksheet again, but this time keeping track of the content that takes the most space for a particular column, and set the column width based on that. Of course, I can also keep track of the max width for a specific column as I write to the sheet, but I feel like it would be cleaner to set the widths after all the data has been already written.</p>
  
  <p>Does anyone know if I can do this? If not, what do you recommend doing in order to adjust the column widths? </p>