1. 程式人生 > >python 將資料寫入execl

python 將資料寫入execl

將資料寫入表格

import xlwt

if __name__ == "__main__":
    book = xlwt.Workbook(encoding='utf8',style_compression=0)
    sheet = book.add_sheet('dede')
    sheet.write(0,0,'hello world')
    sheet.write(1,1,u'中文測試')
    book.save('./1.xls')