当前位置: 首页>>代码示例>>Python>>正文


Python Workbook.use_zip64方法代码示例

本文整理汇总了Python中xlsxwriter.Workbook.use_zip64方法的典型用法代码示例。如果您正苦于以下问题:Python Workbook.use_zip64方法的具体用法?Python Workbook.use_zip64怎么用?Python Workbook.use_zip64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xlsxwriter.Workbook的用法示例。


在下文中一共展示了Workbook.use_zip64方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: toExcel

# 需要导入模块: from xlsxwriter import Workbook [as 别名]
# 或者: from xlsxwriter.Workbook import use_zip64 [as 别名]
    def toExcel(self, outFileName):
        """
        Write the distribution fitter results to an Excel spreadsheet
        :param outFileName: output spreadsheet name
        :type  outFileName: str
        :return: Nothing
        :rtype:  None
        """
        workbook = Workbook(outFileName, {'constant_memory': True})
        workbook.use_zip64() # allow large size Excels just in case

        wks    = workbook.add_worksheet('Distribution Fitting')
        hdrFmt = workbook.add_format({'bold'      : True,
                                      'underline' : True,
                                      'align'     : 'center'})
        resultFormats = [workbook.add_format({'num_format' : fmtStr}) \
                             for fmtStr in ['0.000000', '0.0000%']]

        row = 0
        wks.set_column(0, 0, 11)
        wks.set_column(1, 1,  8,   resultFormats[0])
        wks.set_column(2, 2, 10.6, resultFormats[1])
        for col, headerName in enumerate(self.getHeaderList()):
            wks.write_string(row, col, headerName, hdrFmt)

        for distrName, (results, params) in self.result.iteritems():
            row += 1
            col = 0
            wks.write_string(row, col, distrName)
            for col, (result, outFormat) in \
                     enumerate(itertools.izip(results, resultFormats), col+1):
                wks.write_number(row, col, result, outFormat)
            for col, paramValue in enumerate(params, col+1):
                wks.write_number(row, col, paramValue)

        workbook.close()
开发者ID:gt6989b,项目名称:Config,代码行数:38,代码来源:statistics.py


注:本文中的xlsxwriter.Workbook.use_zip64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。