Skip to content

pb_client.compile.CompiledProgram.pack

pack(*, legacy_main=False)

Build the bytes to store on the hub.

Parameters:

Name Type Description Default
legacy_main bool

Whether the hub needs the entry module to be called __main__. True for Pybricks profiles before v1.5.0, which look the entry module up by that name; from v1.5.0 the first module is run whatever it is called, and its name is what the hub shows as the program's.

False

Returns:

Type Description
bytes

The packed program.