cuewire.port_select

Serial-port chooser helpers.

Functions

choose_port_interactive([clear_screen])

Print available ports and ask the user to pick one.

find_port_by_name(needle)

Return the first port whose device path contains needle.

list_ports()

Return all available serial ports (pyserial ListPortInfo objects).

cuewire.port_select.choose_port_interactive(clear_screen: bool = False) str[source]

Print available ports and ask the user to pick one.

Returns the device path (e.g. /dev/ttyUSB0). Raises IndexError if the user enters an out-of-range number and ValueError if the input is non-numeric.

cuewire.port_select.find_port_by_name(needle: str) str[source]

Return the first port whose device path contains needle.

Raises LookupError if no port matches.

cuewire.port_select.list_ports() Sequence[source]

Return all available serial ports (pyserial ListPortInfo objects).