use the implementation of getch() from python docs