python: pacman with (simulated) user input.