Python Turing machine simulator