Automata fun with python.