Stefan Ram <r...@zedat.fu-berlin.de> wrote: > Chris Green <c...@isbd.net> writes: > >Is the only way to read single characters from the keyboard to use > >curses.cbreak() or curses.raw()? If so how do I then read characters, > > It seems that you want to detect keypresses and not read > characters from a line-buffered console with editing > features. > > Curses is not portable IIRC. A more portable means would > be to use tkinter with the "bind" function to bind keys. > > >All I actually want to do is get 'Y' or 'N' answers to questions on > >the command line. > > answer = input( 'Format drive C: (Y/N)?' ) > ... and therein lies the fundamental problem, you have to type Y or N followed by Return. See my own follow-up though.
-- Chris Green ยท -- https://mail.python.org/mailman/listinfo/python-list