code: def toxlsx(tbl, filename, sheet=None, encoding=None):
      
  
      import openpyxl
      if encoding is None:
          encoding = locale.getpreferredencoding()
      wb = openpyxl.Workbook(write_only=True)
      ws = wb.create_sheet(title=sheet)
      for row in tbl:
          ws.append(row)
      wb.save(filename)
docs: Write a table to a new Excel .xlsx file.