After discussing this issue on github with the creator of the project - magmax (here), I understood that readchar package works only if you try to run it from a terminal but not from any IDE or other non terminal executions. The error is caused because it tries to get the terminal settings which is non existent in this case.
I have been trying to run it from an Wing IDE. The program works great if you try to run it from a terminal.
P.S: magmax suggested to use readchar.keys.ENTER instead of \r . And suggested to have a look at https://github.com/magmax/python-inquirer & its examples
» pip install readchar
After discussing this issue on github with the creator of the project - magmax (here), I understood that readchar package works only if you try to run it from a terminal but not from any IDE or other non terminal executions. The error is caused because it tries to get the terminal settings which is non existent in this case.
I have been trying to run it from an Wing IDE. The program works great if you try to run it from a terminal.
P.S: magmax suggested to use readchar.keys.ENTER instead of \r . And suggested to have a look at https://github.com/magmax/python-inquirer & its examples
Don't use the word 'key' to put your input in, use something like "k". The Readchar module uses the word 'key' in its routine.
k = readchar.readkey()
if(k == 'A'): etc etc