顾名思义,该项目是Python用来处理Excel文档的开发包,无需Windows以及Excel环境的支持。
该项目包含五个子项目:
openpyxl https://pypi.python.org/pypi/openpyxlxlsxwriter https://gitee.com/mirrors/XlsxWriterxlrd https://gitee.com/mirrors/xlrdxlwt https://gitee.com/mirrors/xlwtxlutils https://gitee.com/mirrors/xlutils示例代码:
fromopenpyxlimportWorkbookwb=Workbook()#grabtheactiveworksheetws=wb.active#Datacanbeassigneddirectlytocellsws['A1']=42#Rowscanalsobeappendedws.append([1,2,3])#Pythontypeswillautomaticallybeconvertedimportdatetimews['A2']=datetime.datetime.now()#Savethefilewb.save("sample.xlsx")
评论