Finite automata for python
