rainbows.pl: Ported to Python3.