music.print_peal

music.print_peal(peal, hunts=(0, 1))[source]

Prints a peal with colored numbers. Hunts have also colored background.

Parameters:
peallist

The peal to print.

huntslist, optional

The indices of hunted elements. Defaults to [0, 1].

Raises:
ImportError

If termcolor is not installed: pip install 'music[structures]'.

Notes

There are eight colours, so from the ninth bell on they repeat. A ninth bell used to raise an IndexError instead.

The colours need termcolor, and on an older Windows console colorama, which are imported here rather than with the module. colorama’s init() used to run on import, replacing sys.stdout for the whole process with a wrapper that strips colour from any output not sent to a terminal; just_fix_windows_console() turns colour on where Windows needs it and changes nothing anywhere else.

Examples

>>> peal = PlainChanges(4)
>>> print_peal(peal.peal_direct[:2], hunts=(0, 1))
0123
1023