Keyboard input

Jonathan Gardner jgardner at
Fri Jan 29 23:15:30 CET 2010

On Jan 29, 8:53 am, "Mr.SpOOn" <mr.spoo... at> wrote:
> Hi,
> I need to get keyboard input in a python program. I need it to let the
> user choose some options, for example:
> 1) option 1
> 2) option 2
> 3) option 3
> and then to input some data to the program.
> I'm using the raw_input method and it works fine, but I noted that I
> can't use backspace and when I accidentally press shift space (because
> I need to input uppercase letters separated by a space) it writes some
> strange characters.
> So, is there another way to get keyboard input?

Maybe curses is overkill, but it will do what you need. Most
interactive console apps use curses. You've run into some of the
problems of simply reading STDIN.

More information about the Python-list mailing list