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"))
评论列表
文章目录