music.print_peal¶
- music.print_peal(peal, hunts=(0, 1))[source]¶
Prints a peal with colored numbers. Hunts have also colored background.
- Parameters:
- Raises:
ImportErrorIf 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
IndexErrorinstead.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, replacingsys.stdoutfor 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