openpyxl module Introduction - create excel spreadsheet - and write data

from openpyxl import Workbook

WB = the Workbook ()   # Create a worksheet 
WS = wb.active    # WS operating page sheet 
WS1 = wb.create_sheet ( ' Mysheetfirst ' , 0)


# ------------------------------------------------- -------- 
WS1 [ ' A1 ' ] = ' juankuan ' 
WS1 [ ' E1 ' ] = ' Chinese ' 
WS1 [ ' Fl ' ] = ' 2020-02-27-09-51-02 '

#-----------------------------------------------

wb.save('C:\\Users\\del\\Desktop\\xxxxxx.xlsx')

 

Guess you like

Origin www.cnblogs.com/xiaobaibailongma/p/12387688.html