Skip to content

Instantly share code, notes, and snippets.

@qcom
Created October 18, 2012 06:24
Show Gist options
  • Save qcom/3910165 to your computer and use it in GitHub Desktop.
Save qcom/3910165 to your computer and use it in GitHub Desktop.
import glob
import xlwt
workbook = xlwt.Workbook(encoding='utf8')
worksheet = workbook.add_sheet("Sheet 1")
wrapstyle = xlwt.easyxf("alignment: wrap on")
for count, filename in enumerate(glob.glob("*.html")):
worksheet.row(count).write(0, filename[:-5])
worksheet.row(count).write(1, open(filename).read(), wrapstyle)
workbook.save("result.xls")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment