Emulating the Enigma machine in Python