I have a Python-3 application that has an interactive command-line interface. Now I would like to add non-canonical keyboard input functionality to this application. I would like it to behave much like how Python interpreter handles its keyboard inputs - for example, keys like up-arrow and down-arrow could scroll command histories and other control keys could move the cursor to beginning/end of line, etc.
I had a cursory glance of getkey and keyboard modules, but what is the best (and easiest) Python 3 module that I could use for this feature?

readlinefor this.