writer.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:org-chart-builder 作者: Hitachi-Data-Systems 项目源码 文件源码
def writer(optimised, cols, rows):
    """
    Create a worksheet with variable width rows. Because data must be
    serialised row by row it is often the width of the rows which is most
    important.
    """
    wb = openpyxl.Workbook(optimized_write=optimised)
    ws = wb.create_sheet()
    row = list(range(cols))
    for idx in range(rows):
        if not (idx + 1) % rows/10:
            progress = "." * int((idx + 1) / (1 + rows/10))
            sys.stdout.write("\r" + progress)
            sys.stdout.flush()
        ws.append(row)
    folder = os.path.split(__file__)[0]
    print()
    wb.save(os.path.join(folder, "files", "large.xlsx"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号