大文件读写

https://openpyxl.readthedocs.io/en/stable/optimized.html

  1. from openpyxl import load_workbook
  2. wb = load_workbook(filename='large_file.xlsx', read_only=True)
  3. for row in ws.rows:
  4. for cell in row:
  5. print(cell.value)
  6. from openpyxl import Workbook
  7. wb = Workbook(write_only=True)
  8. ws = wb.create_sheet()
  9. for irow in range(100):
  10. ws.append(['%d' % i for i in range(200)])
  11. >>> wb.save('new_big_file.xlsx')