Writing xlsb files from python isn't supported in pyxlsb library. Aspose.Cells for Python is capable of building cross-platform applications with the ability to generate, modify, convert, render and print all Excel files inclding xlsb file. It is a commercial tool.
It requires Python <=3.13, >=3.8.
Here's the sample code:
import jpype
import asposecells
jpype.startJVM()
from asposecells.api import Workbook, FileFormatType
# Create Workbook object.
workbook = Workbook(FileFormatType.XLSB)
# Access the first worksheet of the workbook.
worksheet = workbook.getWorksheets().get(0)
# Get the desired cell(s) of the worksheet and input the value into the cell(s).
worksheet.getCells().get("A1").putValue("ColumnA")
worksheet.getCells().get("B1").putValue("ColumnB")
worksheet.getCells().get("A2").putValue("ValueA")
worksheet.getCells().get("B2").putValue("ValueB")
# Save the workbook as XLSB file.
workbook.save("output.xlsb")
jpype.shutdownJVM()
Other options are writing .xlsx in Python (pandas, openpyxl or xlsxwriter) and then manually saving as .xlsb from Excel or win32com.client (Windows only)