Simple to use python3openpyxl library

python3 operating table has a lot of libraries, mainly to tell you about now I prefer openpyxl library use, the installation installed directly pip, pip have questions about installation can refer to my article about pip used.

Workbook = wb () # Create a table 
wb.save (filename = "" ) # Save Forms 
wb.load_workbook () # open an existing table 
WS = wb.active # selected current form active Sheet 
WS = wb.creat_sheet (title = ' ) # Create a sheet 
ws.cell (row =. 1, column =. 1) .Value = ' # to ws the sheet into the first column of the first row 
ws.max_column # Get the maximum number of columns 
ws.cell (row . 1 =, = column. 1) .Value # obtaining a first row and first column value 
WS [ ' A1 ' ] .column # Get the number of data columns

The basic operations are here, do not understand the message whisper

 

Guess you like

Origin www.cnblogs.com/busishum/p/11788275.html