Pip Install XLWT
Python Excel data write operations, processing Web site data export and not too much data Crawler storage, the use of a lot of wheels.
(150+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=)
1 #Coding:utf-82 ImportXLWT3 fromXlwtImportWorkbook4 5 6WB =Workbook ()7WS = Wb.add_sheet ('Product')8Ws_1 = Wb.add_sheet (' Other')9 TenFontSize = XLWT.EASYXF ('font:height, name Calibri; Align:horiz Center;')#Font Customization One ARow0 = [u'Nominal', u'links', u'Notes'] -Row1 = [u'name', u'file', u'URL'] - the defTitle_write (ROW,WS): - #Generate title - forIinchRange (0,len (row)): -Col =Ws.col (i) +Col.width=256*18 - ifi = = (len (row)-1): +Ws.col (i). width = 256*23 AWs.write (0,I,ROW[I],XLWT.EASYXF ('font:height, name Arial_unicode_ms, Colour_index Black, bold On;align:horiz center;')) at - title_write (ROW0,WS) - title_write (row1,ws_1) - -data = [{'1': [u'The detective of Sherlock Holmes collection', u'http://www.fuermositanan.com/', u'Reasoning'],'2': [u'The Sherlock Holmes stories', u'Arthur Conan Doyle', u'https://ebooks.adelaide.edu.au/d/doyle/arthur_conan/']}]#here the demo is dead and changed according to the actual needs - inx = 1 - forIinchData: toRows_0 = i['1'] +Rows_1 = i['2'] - defRows_write (CONTENT,WS): the #Generate Content * forNum,rowsinchEnumerate (content): $RowsifRows! = NoneElse "'Panax Notoginseng ws.write (x, num, rows, fontSize) - rows_write (ROWS_0,WS) the rows_write (rows_1,ws_1) +x + = 1 A theFname='Books.xls' +Wb.save (fname)
Python Excel Multiple sheet multiple data custom write