title: python: creating excel workbook and dumping csv files as worksheets
body: <p>I have few csv files which I would like to dump as new worksheets in a excel workbook(xls/xlsx).
  How do I achieve this?</p>
  
  <p>Googled and found 'pyXLwriter' but it seems the project was stopped.
  While Im trying out 'pyXLwriter' would like to know are there any alternatives/suggestions/modules?</p>
  
  <p>Many Thanks.</p>
  
  <p>[Edit]</p>
  
  <p>Here is my solution: (anyone has much leaner, much pythonic solution? do comment. thx)</p>
  
  <pre><code>import glob
  import csv
  import xlwt
  import os
  
  wb = xlwt.Workbook()
  
  
  for filename in glob.glob("c:/xxx/*.csv"):
      (f_path, f_name) = os.path.split(filename)
      (f_short_name, f_extension) = os.path.splitext(f_name)
      ws = wb.add_sheet(str(f_short_name))
      spamReader = csv.reader(open(filename, 'rb'), delimiter=',',quotechar='"')
      row_count = 0
      for row in spamReader:
          for col in range(len(row)):
              ws.write(row_count,col,row[col])
          row_count +=1
  
  wb.save("c:/xxx/compiled.xls")
  
  print "Done"
  </code></pre>