This is an example I used to test the disp_bin Python function I wrote to take a number and display it in binary on a Pimoroni Blinkt! board. The function takes a number (of which it will display the lower 8 bits) and colors for the 0 and 1 LEDs.
Requires the blinkt Python module
sudo apt-get install python-blinkt